draftjs how to apply bold from cursor location?

I was wondering how to toggle BOLD to text starting from cursor position. RichUtils allows me to use ctrl-b command to toggle bold, which is what I want but with a button. If i currently click my button (richUtils.toggleInlineStyles()) it only applies bold to highlighted text. But I want it to be bold when start typing from cursor position.

How would you achieve this?

1 answer