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

[FR] add actions to increase/decrease indentation #904

Open
TatsuUkraine opened this issue Sep 28, 2024 · 4 comments
Open

[FR] add actions to increase/decrease indentation #904

TatsuUkraine opened this issue Sep 28, 2024 · 4 comments
Assignees

Comments

@TatsuUkraine
Copy link

Description

Ability to update indentation

Impact

Update text indentation, create nested lists

Additional Context

No response

@LucasXu0 LucasXu0 self-assigned this Oct 15, 2024
@LucasXu0
Copy link
Collaborator

Using tab to indent should work.

If you want to extend more blocks to support indent, you can add the types into this array.

final indentableBlockTypes = {
  BulletedListBlockKeys.type,
  NumberedListBlockKeys.type,
  TodoListBlockKeys.type,
  ParagraphBlockKeys.type,
};

@TatsuUkraine
Copy link
Author

I was searching for an easy way to programmatically increase/decrease indentation for a selection in the mobile app, using custom toolbar actions

@TatsuUkraine
Copy link
Author

TatsuUkraine commented Oct 15, 2024

I build own logic to update delta in the editor on button click since I didn't find sort of like a command, where you can pass selection, so it could update list items indentation for me, similar to toggleAttribute or formatNode

@LucasXu0
Copy link
Collaborator

You can execute the command directly, but it relies on the selection. You must set a selection before executing this command.

indentCommand.execute(editorState);

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

No branches or pull requests

2 participants