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

Add more advanced formatting documentation #29181

Closed
mahnunchik opened this issue Feb 20, 2021 · 4 comments
Closed

Add more advanced formatting documentation #29181

mahnunchik opened this issue Feb 20, 2021 · 4 comments
Labels
[Type] Developer Documentation Documentation for developers

Comments

@mahnunchik
Copy link

What problem does this address?

It is not clear how to show Popover on RichTextToolbarButton click?

What is your proposed solution?

It would be useful to have sample here: https://developer.wordpress.org/block-editor/tutorials/format-api/2-toolbar-button/

@talldan talldan added the [Type] Developer Documentation Documentation for developers label Feb 25, 2021
@talldan
Copy link
Contributor

talldan commented Feb 25, 2021

@mahnunchik the RichTextToolbarButton is a shortcut for adding simple formatting, but the edit function when registering a format can be any react component.

The easiest option is to implement a component that uses a Dropdown or DropdownMenu component and make the renderToggle prop return a ToolbarButton.

The Link format is probably the only one in the gutenberg codebase that's a bit more advanced:
https://github.com/WordPress/gutenberg/blob/master/packages/format-library/src/link/index.js

Agree that this is something the docs could expand on, so will leave this ticket open as a documentation enhancement.

@talldan talldan changed the title How to show Popover on RichTextToolbarButton click? Add more advanced formatting documentation Feb 25, 2021
@mahnunchik
Copy link
Author

There are issues related to RichTextToolbarButton position in the Toolbar:

@talldan
Copy link
Contributor

talldan commented Feb 25, 2021

Right, I see, the formats that appear on the main toolbar are hard-coded.

And a dropdown in a dropdown may be undesirable.

@ryanwelcher
Copy link
Contributor

This looks to have been addressed with #43581 so I'll close it. If there are further issues, please feel free to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

No branches or pull requests

3 participants