Replies: 1 comment
-
Question 1We don't have a way to add arbitrary props to the import { QueryBuilder, useValueSelector } from 'react-querybuilder';
const A11yValueSelector = (props: VersatileSelectorProps) => {
const { onChange, val } = useValueSelector(props);
const selectElementChangeHandler = useSelectElementChangeHandler({ multiple: props.multiple, onChange });
const ariaLabel = `...some logic here based on props...`;
return (
<select
aria-label={ariaLabel} // <--- Added
data-testid={props.testID}
className={props.className}
value={val}
title={props.title}
disabled={props.disabled}
multiple={!!props.multiple}
onChange={selectElementChangeHandler}
>
{toOptions(props.options)}
</select>
);
};
const App = () => (
<QueryBuilder controlElements={{ valueSelector: A11yValueSelector }} />
);Question 2This is a much easier one to answer: use the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to
adding the rules (Instead of the default "Query Builder") and inside group (Instead of Rule at path 0-0-0 etc)
Beta Was this translation helpful? Give feedback.
All reactions