Commit 8848b6c
committed
Fix dropdown resetting focus
Various dropdown (Table filters, workflow selector, pretty much
everything in the ACL tab) would
seemingly randomly have their
focus reset to the top element
every couple of seconds.
This would make them hard or even impossible to navigate by users.
This patch aims to fix that.
The culprit here is a selector hook at the app level. The `Stats`
component (the various numbers next to the "Add Event" button)
would trigger this hook about every 5 seconds, causing the
whole app to rerender and the
dropdowns to reset focus.
The proposed solution is to not use a selector. This will make our
custom hook `useTableFilterStateValidation`
effectively only run once on page load. I would argue this is fine, as
we do not expect the state to corrupt while the app is running
and thus don't need to check for corrupt state everytime the state
changes.1 parent a89897b commit 8848b6c
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
0 commit comments