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

Feature: Lists should be toggleable #6733

Open
BennyAlex opened this issue Oct 15, 2024 · 4 comments
Open

Feature: Lists should be toggleable #6733

BennyAlex opened this issue Oct 15, 2024 · 4 comments
Labels
enhancement Improvement over existing feature

Comments

@BennyAlex
Copy link

BennyAlex commented Oct 15, 2024

Description

If you dispatch a list command like INSERT_UNORDERED_LIST_COMMAND it will not toggle a list back to normal.
This is different from formatting a text with bold, italic etc.

So I want to recreate the keyboard shortcuts from word. Using Ctrl + Shift + L can toggle a list.
This should be the default behavior as users a used to it.

It could also be solved by adding a seperate toggle command.

I think text alignment it is the same.
Also it is the same for headlines (the dropdown in the playground).
If you select the same style again, it should be reverted.

@BennyAlex BennyAlex added the enhancement Improvement over existing feature label Oct 15, 2024
@etrepum
Copy link
Collaborator

etrepum commented Oct 16, 2024

You could certainly do this on your own by registering the command at a higher priority, detecting if the selection is on a list, and then removing the list. Since lists can be nested I think either approach is probably valid, and it would be harder to override the toggle logic if that was the default.

@BennyAlex
Copy link
Author

BennyAlex commented Oct 16, 2024

One suggestion was just adding a toggle command so its there out of the box.

I cant create a nested list inside the playground and also not in word using the keyboard shortcut so I think having the same behaviour would be the best.

Headlins cannot be nested at all so that should definitely toggle the mode.

@etrepum
Copy link
Collaborator

etrepum commented Oct 16, 2024

Looks like you're right that the command does not allow you to create nested lists, but the implementation does allow it and that's how multiple levels work. For example if you look at this document you can see several list nodes nested in listitem nodes

@BennyAlex
Copy link
Author

Yes I dont say the are wrong or should not be possbile but using a keyboard short cut or the command should toggle the current list I guess

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

No branches or pull requests

2 participants