Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable filter should provide defaults for constraints and operator #7019

Open
1 of 4 tasks
mrichar1 opened this issue Dec 27, 2024 · 0 comments
Open
1 of 4 tasks
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Milestone

Comments

@mrichar1
Copy link
Contributor

Describe the bug

This is a 're-issue' of #1669 against PrimeVue 4.

When using Filter menu mode, if the filters object doesn't contain a constraints property, then when the match mode is selected from the UI the app crashes with the following error in the console:

_filters[this.field].constraints is undefined

Separately, if constraints is provided, but operator is unset, the UI doesn't display the Add Rule button, even if showFilterOperator is true.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-3s53jroz

Environment

Ubuntu Linux 22.04 (but reproducible in sandbox)

Vue version

3.4.31

PrimeVue version

4.2.25

Node version

20.18.1

Browser(s)

No response

Steps to reproduce the behavior

  1. Click on the filter icon - no errors in console and 'Add rule' button exists in UI.
  2. Comment-out 'working' filter line and uncomment second one.
  3. Click on the filter icon - error in console.
  4. Comment out filter and uncomment 3rd one.
  5. Click on filter icon - Add rule is missing from UI.

Expected behavior

There should be defaults set in the code such that not setting constraints or operator does not result in an error/unexpected behaviour.

There is detailed discussion of what these defaults might look like in the previous issue which I won't try to reproduce here.

@mrichar1 mrichar1 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 27, 2024
@mertsincan mertsincan added this to the 4.3.1 milestone Jan 6, 2025
@github-project-automation github-project-automation bot moved this to Review in PrimeVue Jan 6, 2025
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
Status: Review
Development

No branches or pull requests

2 participants