-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Default Block Appender: Remove redundant event handlers #8714
Conversation
The input has "role" button and in Firefox I think, buttons don't get the focus when you click on them, so might be good to check. I can do it a bit after. |
Interesting to note and, if true, would be good to leave a comment clarifying this, as it's not obvious at a glance. I should clarify part of the goal here is to sanity check myself in asking "Is it possible to click a button without also causing it to receive focus?" |
Yeah, just rediscovered this one as well. The difference is that this is not a |
Related: #1195 (comment) (when it was |
I tested and it works well in Firefox too. I wonder if we should be cautious? Is there any particular reason for removing those? Extra actions? Anyway, I'm fine either way and there's a failing unit test. |
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.
LGTM 👍
If it serves no purpose, it shouldn't exist. |
My thinking was that maybe some browsers do weird things here, and it's hard to test all supported browsers, but yes, it's fine. |
Do you recall why we chose to use I'm wondering if it's perhaps related to this. |
I think it's because of this #4829 (comment) |
I'd rather we have code we understand well than code which exists to hope to protect against some unknown browser behaviors. |
That sounds right. What I'll do is add an inline code comment explaining both why it's an input and, if it were to be a button, the caveat about Firefox behavior. |
16fa8aa
to
88991ff
Compare
Added comment and updated tests in rebased 88991ff |
Going to save this one for after release. |
Related: #3623 (comment)
This pull request seeks to remove two of the three event handlers from the
DefaultBlockAppender
component:onClick
andonKeyDown
. This operates on the assumption that it is not possible to click or keydown the input without theonFocus
event already having been handled, incurring the replacement of the default block.Testing instructions:
Verify there are no regressions in the behavior of the default block appender.
Ensure end-to-end tests pass: