Gutenberg: Links can be added to the Button Block's text using the shortcut

Created on 28 May 2019  路  4Comments  路  Source: WordPress/gutenberg

Describe the bug
The button block has its own UI for adding links. However, a user can also highlight the text in the button when editing a button block and use Cmd+K or Ctrl+K to add link formatting to button text.

This duplication is confusing.

To reproduce
Steps to reproduce the behavior:

  1. Create a new post
  2. Add a button block
  3. Type some text in the button
  4. Highlight the text in the button
  5. Use the Cmd+K (Mac) or Ctrl+K (Windows/Linux) keyboard shortcut
  6. Observe that link formatting can be applied to the button's text.

Expected behavior
The link format should be disabled on the button block as it has its own interface for adding links.

Screenshots
Screen Shot 2019-05-28 at 4 25 01 pm

Additional context
Discovered while testing #10128

[Block] Buttons [Package] Rich text [Type] Bug

Most helpful comment

Should be fixed by #14542.

All 4 comments

This line:

https://github.com/WordPress/gutenberg/blob/5cb8b8f3a025e4ecf24b9b3ec31988b2c7b02d5c/packages/block-library/src/button/edit.js#L81

excludes the "link" rich text format from the toolbar (and hotkeys?), but it doesn't seem to be doing anything.

cc @ellatrix

I鈥檝e noticed this as well - it seems like the behaviour around which controls are visible does not impact all keyboard shortcuts.

(Also worth noting that the formats in the drop down are visible even though they aren鈥檛 explicitly enabled in formattingControls.)

Should be fixed by #14542.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JohnPixle picture JohnPixle  路  3Comments

moorscode picture moorscode  路  3Comments

hedgefield picture hedgefield  路  3Comments

ellatrix picture ellatrix  路  3Comments

davidsword picture davidsword  路  3Comments