DataTable filter should provide defaults for constraints and operator #7019
Labels
Status: Pending Review
Issue or pull request is being reviewed by Core Team
Milestone
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 aconstraints
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, butoperator
is unset, the UI doesn't display theAdd Rule
button, even ifshowFilterOperator
istrue
.Pull Request Link
No response
Reason for not contributing a PR
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
filter
line and uncomment second one.filter
and uncomment 3rd one.Add rule
is missing from UI.Expected behavior
There should be defaults set in the code such that not setting
constraints
oroperator
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.
The text was updated successfully, but these errors were encountered: