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

Typing text at the end of a styled area #162

Closed
benedictleejh opened this issue Jul 23, 2015 · 3 comments
Closed

Typing text at the end of a styled area #162

benedictleejh opened this issue Jul 23, 2015 · 3 comments

Comments

@benedictleejh
Copy link

When the caret is placed at the end of a styled section, any new typed text will also belong to that styled section. Sometimes, this is what you want, but not all the time. For those times where you don't want the new text to inherit the style of the styled section, how can I temporarily disable that extending of the previous style span when new text is typed?

@ghost
Copy link

ghost commented Aug 10, 2015

Why not apply a new style to caret position, then enter the new text?

@TomasMikula
Copy link
Member

I'm sorry, somehow I missed this before. You can set the useInitialStyleForInsertion property to true to use the default style of the text area, instead of the style immediately before the caret. To reset the behavior, just set it back to false.

@melkhaldi One can apply style only to a non-empty range of text, i.e. style of at least one character would have to be updated.

@benedictleejh
Copy link
Author

Thanks @TomasMikula, that's exactly what I was looking for.

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