draft-js icon indicating copy to clipboard operation
draft-js copied to clipboard

When select empty area then text, RichUtils.toggleInlineStyle is misbehaving somewhere

Open rishu1824 opened this issue 6 years ago • 0 comments

Do you want to request a feature or report a bug? Hello, I am using draft js editor with basic functionalities (inline styles-bold ,italic ,underline) I have created a toolbar having icons of Bold Italic etc. For getting information like what icon is activated on which text i am using code like currentStyle =editorState.getCurrentInlineStyle(); then currentStyle.has(type.style); this is working fine for all scenario's except one. When User try to select empty textarea then some text, and try to apply inline style(BOLD) then BOLD icon is not activating because currentStyle.has(type.style) is giving false but BOLD is applied for selected text.

Expected Behaviour: BOLD icon should activate or currentStyle.has(type.style) should work similar as for other cases.

Am i missing something?

rishu1824 avatar Jun 09 '20 10:06 rishu1824