-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter panel key listener fix #158
base: master
Are you sure you want to change the base?
Filter panel key listener fix #158
Conversation
…y warning for key listeners
Wait with merging this! Bug still occurs on
fields. |
I would say, this approach is a bit too manual; could we check if there is a focused element with |
Will take another look at activeElement when I have time. |
I have looked at activeElement and this is a functionality that while it might also work, creates an overhead and duplicate code because we will need to check all future inputs for the same activeElement functionality. For this reason, it is better to incorporate the functionality as it is now because it means that every time we use the TextField component, the App automatically gets the dispatched onFocus and onBlur functionality. This means that we do not duplicate code and also have less code to do the same thing in the long run. Tell me what you think again. |
If you check if anything is focused (except the graph itself) then you can ignore keyboard inputs, not sure what you mean by it introducing overhead / duplicate code when the goal is to only have a single check for everything. |
I'll have to retract my previous statement, you are indeed correct. However - if all text fields used the TextField component then this solution would be just as effective as activeElement. Shouldn't this be encouraged, in order to limit the amount of custom code since just using the native input probably means more fiddling with those specific areas in the code? If I could choose I would probably make sure that every text field is of the TextField component and listen to it as it is implemented in this PR. Would you still like the refactor to activeElement instead? |
Sorry I ignored my notifcations for a bit, but my stance is still the same; while reusing components is good we should also reuse the facilities the browser already gives us, like focus management. Also I dont want to maintain this kind of pattern in the future, when adding new things that need focus this will keep popping up. |
Closes #157