make new rule selected by default #658
kuljeet2604
started this conversation in
General
Replies: 2 comments 7 replies
-
Either of the following configurations will work: const defaultQuery = { combinator: 'and', rules: [
{ field: 'defaultField', operator: '=', value: 'default value' }
]};
const App = () => (
<QueryBuilder defaultQuery={defaultQuery} />
); const App = () => (
<QueryBuilder addRuleToNewGroups />
); Docs for the second example here: https://react-querybuilder.js.org/docs/components/querybuilder#addruletonewgroups Note that the second example only works if both |
Beta Was this translation helpful? Give feedback.
4 replies
-
i tried v7 still first value (if options value is supplied), gets selected for input type text. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i want my initial state of query to be first like we pressed +rule button
Beta Was this translation helpful? Give feedback.
All reactions