-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Fix: navbar should close when user click anywhere on screen #565
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I am unsure about using document.addEventListener
and directly interacting with the DOM, I suggest we probably use some react event handler such as onBlur
instead.
Normally you shouldn’t need to do this with React: you need to manually locate the elements using refs, which kinda breaks how React should work.
Hey @DarhkVoyd, I appreciate your suggestion but Could you please guide me how this can be done without manipulating dom and using onblur? |
Hey @lalitkumawat1m So, after thinking more about it, I think that your approach is the better way. I was earlier thinking about making the navbar focusable and then using onBlur listener to handle blur cases but I realised it would be unnecessary. I understand now that the use of |
The one thing I am still confused about is the use of |
Hi Lalit. Can you please check the comments done by DV? |
Hey @benjagm @DarhkVoyd I have made the requested changes. Please have a look |
Looks mostly good. just some suggestions,
|
Hey @DarhkVoyd,
|
Sure |
I have made the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for fixing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
What kind of change does this PR introduce?
Issue Number:
Screenshots/videos:
JSON.Schema.-.Personal.-.Microsoft.Edge.2024-03-20.18-07-05.mp4
If relevant, did you update the documentation?
No
Summary
Does this PR introduce a breaking change?
No