You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Details Block] The space key doesn't work (Firefox) #49679
Browser IssuesIssues or PRs that are related to browser specific problemsNeeds Technical FeedbackNeeds testing from a developer perspective.[Block] DetailsAffects the Details Block - used to display content which can be shown/hidden[Type] BugAn existing feature does not function as intended
I think this is a problem unique to Firefox. If I give the summary element, or any of its children, the contententeditable attribute and press the space key in the text, it is treated as a click event and no space is inserted.
I can reproduce this and I have tried to use different combinations of "KeyUp" instead of "onClick" for the prevent, but I have been unable to solve it.
I tried both with the separate <summary> element as a wrapper for the RichText (the way the block is currently built) and using summary as a tag in the RichText.
I'm not sure if we can add any workarounds to RichText, or if we should just wait for the firefox bug to be resolved. It seems like it's being considered a normal priority, but I left a comment asking why that is and if there's a workaround.
There's a suggestion for a workaround from a Firefox maintainer:
Currently, the workaround is not use contenteditable in the elements or prevent default of space keydown events and do document.execCommand("insertText", false, " ").
Browser IssuesIssues or PRs that are related to browser specific problemsNeeds Technical FeedbackNeeds testing from a developer perspective.[Block] DetailsAffects the Details Block - used to display content which can be shown/hidden[Type] BugAn existing feature does not function as intended
Activity
t-hamano commentedon Apr 10, 2023
@gyurmey2
Tahnks for the rerport. I was able to reproduce it too.
Firefox Version: 111.0.1 (64-bit)
f4b24416bed753812c0eb9857b798a01.mp4
t-hamano commentedon Apr 10, 2023
I think this is a problem unique to Firefox. If I give the
summaryelement, or any of its children, thecontententeditableattribute and press the space key in the text, it is treated as a click event and no space is inserted.Here is the code I used to test:
carolinan commentedon Apr 16, 2023
I can reproduce this and I have tried to use different combinations of "KeyUp" instead of "onClick" for the prevent, but I have been unable to solve it.
I tried both with the separate
<summary>element as a wrapper for the RichText (the way the block is currently built) and using summary as a tag in the RichText.talldan commentedon May 11, 2023
Here's the bug report for firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=1822860. It has been triaged and accepted which is good.
I'm not sure if we can add any workarounds to RichText, or if we should just wait for the firefox bug to be resolved. It seems like it's being considered a normal priority, but I left a comment asking why that is and if there's a workaround.
talldan commentedon May 11, 2023
There's a suggestion for a workaround from a Firefox maintainer:
The latter sounds like a good option 👍
t-hamano commentedon May 11, 2023
I am trying to fix in #50540.