Skip to content
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

Cmd + K to add link to a Button block focuses the browser address bar in Firefox #21777

Closed
talldan opened this issue Apr 22, 2020 · 6 comments · Fixed by #22215
Closed

Cmd + K to add link to a Button block focuses the browser address bar in Firefox #21777

talldan opened this issue Apr 22, 2020 · 6 comments · Fixed by #22215
Assignees
Labels
[Block] Buttons Affects the Buttons Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended

Comments

@talldan
Copy link
Contributor

talldan commented Apr 22, 2020

Describe the bug
Using a shortcut to add a link to the button block doesn't work in Firefox. Furthermore, multiple link popovers can be opened for multiple buttons (though this problem will likely go away when the first issue is fixed).

To reproduce
Steps to reproduce the behavior:

  1. Create a post in Firefox (Tested on Mac OS X)
  2. Add a Buttons block
  3. Press Cmd+K to add a link to the block
  4. Observe that the browser address or search bar is focused prompting the user to search
  5. Add another button to the buttons block
  6. Press Cmd+K again.
  7. Observe multiple overlapping LinkControl popovers

Expected behavior
The link popover is focused when using the shortcut (preventDefault).

Clicking outside an opened popover closes it.

@talldan talldan added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time [Block] Buttons Affects the Buttons Block labels Apr 22, 2020
@afercia
Copy link
Contributor

afercia commented Apr 22, 2020

For me, macOS Firefox in English, Cmd+K focuses the Firefox Search instead (the one on the right of the address bar). I think the standard Firefox shortcut to focus the address bar is Cmd+L (L as "Location"), at least for English.

@talldan
Copy link
Contributor Author

talldan commented Apr 23, 2020

@afercia Good point. I think it's possible to have Firefox setup to either have separate search and address bars or a single unified bar. I have the latter configured in my Firefox.

@afercia
Copy link
Contributor

afercia commented Apr 23, 2020

Ah good point. Maybe new installations get the unified bar? I guess old installations that get updated retain old settings.

@afercia
Copy link
Contributor

afercia commented Apr 23, 2020

For reference: here's the related Firefox preference:

Screenshot 2020-04-23 at 08 44 30

And yes, when "Use the address bar for search and navigation" is on, Cmd+K moves focus to the unified address/search bar.

Regardless, wouldn't this be solved with a simple preventDefault()?

@kirilzh
Copy link
Contributor

kirilzh commented May 7, 2020

I traced the bug down to

[ rawShortcut.primary( 'k' ) ]: openLinkControl,

Currently there doesn't seem to be a way to preventDefault in <KeyboardShortcuts />

@talldan
Copy link
Contributor Author

talldan commented May 8, 2020

I think that would be handled in the openLinkControl event handler, @kirilzh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants