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

Not sure I understand the NestedUtils.toggleBlocktype #28

Open
SamyPesse opened this issue Jun 17, 2016 · 3 comments
Open

Not sure I understand the NestedUtils.toggleBlocktype #28

SamyPesse opened this issue Jun 17, 2016 · 3 comments
Labels

Comments

@SamyPesse
Copy link
Collaborator

What is the goal of NestedUtils.toggleBlocktype compared to RichUtils.toggleBlocktype ?

I've tried it integrate it into a test application but it doesn't change the block type (editorState stays the same).

@mitermayer
Copy link
Owner

mitermayer commented Jun 19, 2016

At the moment, we did not want to duplicate integrations from toggleBlock, so toggleBlock on nested utils levarage from default behaviour of richUtilsToggleBlock, example

clicking toggle on to move from UL to OL converts
UL > LI > H1
to
OL > LI > unstyled
RichUtils.toggleBlock will then
OL > LI > H1

but place cursor selection on the 'unstyped' and uses the blockType 'header-one' to be passed back to the rich utils so that it toggle it back to 'header-one'

This sort of behaviour is a bit of temporary measure so that we don't duplicate code. Maybe nested utils should extend richUtils to avoid this sort of things

@mitermayer
Copy link
Owner

If nested Utils can't handle the block it will return the same editorState, since its meant to be passed to richUtils toggle block

@mitermayer
Copy link
Owner

I think maybe we should make nestedUtils extend the richUtils and not expect user to use both at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants