Skip to content

Commit d212029

Browse files
Changes made as per PR feedback
1 parent 722f7a7 commit d212029

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

vuu-ui/packages/vuu-filters/src/filter-clause/useFilterClause.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ export const useFilterClause = ({
5353
const valueRef = useRef<HTMLDivElement | null>(null);
5454
const filterTouched = useRef(false);
5555

56-
const setTouched = useCallback(() => {
57-
if (!filterTouched.current) filterTouched.current = true;
58-
}, []);
59-
6056
const setValueRef = useCallback<RefCallback<HTMLDivElement>>(
6157
(el) => {
6258
valueRef.current = el;
@@ -193,9 +189,9 @@ export const useFilterClause = ({
193189
() => ({
194190
onKeyDownCapture: handleKeyDownCaptureNavigation,
195191
tabIndex: -1,
196-
onFocus: () => setTouched(),
192+
onFocus: () => filterTouched.current = true,
197193
}),
198-
[handleKeyDownCaptureNavigation, setTouched],
194+
[handleKeyDownCaptureNavigation],
199195
);
200196

201197
// Do we need this or can we leave it to the filterEditor
@@ -214,7 +210,7 @@ export const useFilterClause = ({
214210
inputRef.current?.querySelector("input")?.focus();
215211
});
216212
}
217-
}, [filterClauseModel, setTouched]);
213+
}, [filterClauseModel]);
218214

219215
return {
220216
inputProps,

vuu-ui/showcase/src/examples/DataTable/Tree.data.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,16 @@ export default [
578578
path: "src/examples/Filters/FilterClause/FilterClause.examples.tsx",
579579
},
580580
},
581+
{
582+
id: "Filters/FilterClause/FilterClause/MultipleFilterClauseControlsWithDropDownAutofocusDisabled",
583+
label:
584+
"MultipleFilterClauseControlsWithDropDownAutofocusDisabled",
585+
nodeData: {
586+
componentName:
587+
"MultipleFilterClauseControlsWithDropDownAutofocusDisabled",
588+
path: "src/examples/Filters/FilterClause/FilterClause.examples.tsx",
589+
},
590+
},
581591
{
582592
id: "Filters/FilterClause/FilterClause/NewFilterClause",
583593
label: "NewFilterClause",
@@ -621,18 +631,15 @@ export default [
621631
},
622632
{
623633
id: "Filters/FilterClause/FilterClause/FilterColumnWithDropdownOpenOnFocusDisabled",
624-
label:
625-
"FilterColumnWithDropdownOpenOnFocusDisabled",
634+
label: "FilterColumnWithDropdownOpenOnFocusDisabled",
626635
nodeData: {
627-
componentName:
628-
"FilterColumnWithDropdownOpenOnFocusDisabled",
636+
componentName: "FilterColumnWithDropdownOpenOnFocusDisabled",
629637
path: "src/examples/Filters/FilterClause/FilterClause.examples.tsx",
630638
},
631639
},
632640
{
633641
id: "Filters/FilterClause/FilterClause/FilterColumnAndOperatorWithDropdownOpenOnFocusDisabled",
634-
label:
635-
"FilterColumnAndOperatorWithDropdownOpenOnFocusDisabled",
642+
label: "FilterColumnAndOperatorWithDropdownOpenOnFocusDisabled",
636643
nodeData: {
637644
componentName:
638645
"FilterColumnAndOperatorWithDropdownOpenOnFocusDisabled",

0 commit comments

Comments
 (0)