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

Blocks can still be inserted from the list next to the inserter even if useOnce is true #3968

Closed
fastlinemedia opened this issue Dec 13, 2017 · 6 comments
Assignees
Labels
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

@fastlinemedia
Copy link

Issue Overview

I've created a block and set useOnce to true, however I'm still able to insert it when it shows up in the quick links next to the inserter. Notice in the screenshot below how my Test Block is greyed out in the actual inserter but can still be highlighted and clicked in the quick links.

screenshot 2017-12-12 21 50 18_preview

Steps to Reproduce (for bugs)

  1. Create a block with useOnce set to true.
  2. Use the block enough times that it shows up in the quick links.
  3. You can insert it more than once using the quick links even though useOnce is true.

Expected Behavior

You should be able to only insert the block once.

Current Behavior

You can insert the block more than once.

@youknowriad youknowriad added 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 labels Dec 13, 2017
@youknowriad
Copy link
Contributor

I guess we should check the "autocompleter" as well.

@aduth
Copy link
Member

aduth commented Dec 15, 2017

Fixed in #3988

@aduth aduth closed this as completed Dec 15, 2017
@ocean90
Copy link
Member

ocean90 commented May 17, 2018

It seems like this issue has been reintroduced at some point. The code from #3988 does no longer exist, see https://github.com/WordPress/gutenberg/blob/63abd32d9b5cb809ad71167f209dd7a6d0a79a3f/editor/components/inserter-with-shortcuts/index.js

@youknowriad Yep, it's also not disabled in the autocompleter.

@ZebulanStanphill
Copy link
Member

Thanks to #7166, disabled blocks can no longer be inserted from the autocompleter. However, the frecent block inserter buttons still let you insert disabled blocks, though there is now an error message shown when you do so:
image

@Soean
Copy link
Member

Soean commented Jun 16, 2018

Can't reproduce anymore, issue seems to be fixed.

@Soean Soean closed this as completed Jun 16, 2018
@ZebulanStanphill
Copy link
Member

@Soean I can still reproduce in master.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

No branches or pull requests

7 participants