Gutenberg: Can't set the URL in a Button Block to open in new tab

Created on 11 Dec 2018  路  5Comments  路  Source: WordPress/gutenberg

Describe the bug
URL's in Button Blocks should have the option to open in a new tab, just like URL's added to links in Paragraph Blocks.

To Reproduce
Steps to reproduce the behavior:

  1. Add Button Block
  2. Add URL and try to get it to open in a new browser window/tab

Expected behavior
All URL fields in Gutenberg should have the option to be opened in a new tab.

Desktop (please complete the following information):

  • macOS Sierra
  • Firefox Quantum 63.0.3
  • WP 5.0
[Block] Buttons [Type] Enhancement

Most helpful comment

Adding that this has also been suggested in #8000

All 5 comments

I tried editing it in HTML mode to add the target="_blank", but once back to block mode it detects it as invalid, and converts it to a HTML block instead.

Adding that this has also been suggested in #8000

I'm finding I'm needing this more and more often as I use the block editor. At the very least, it would be good if the block would at least not be invalidated by adding the attributes via the code editor

+1 on wanting this feature. The HTML workaround gets the job done but it's not a good long-term solution since the block shows an error.

Edit: I see the #8000 has a PR where this is getting introduced. Thank you all!

Thanks @annestk! Closing in favor of #8000.

Was this page helpful?
0 / 5 - 0 ratings