facebookarchive/draft-js

getCurrentInlineStyle behaves inconsistently

Open

#722 建立於 2016年10月17日

在 GitHub 查看
 (3 留言) (6 反應) (0 負責人)JavaScript (22,554 star) (2,646 fork)batch import
bughelp wanted

描述

I believe there is a bug in getCurrentInlineStyle (or, if it's current behavior is intentional, it is inconsistent with typical rich text editor behavior).

When selecting a block of text in which different characters have different styles, getCurrentInlineStyle usually doesn't show styles that aren't applied to the entire selection. This seems to be standard practice. However, it will show styles that are applied to the very start of the selection, even if they aren't applied throughout, which seems inconsistent.

This can be observed in the sample editor at https://facebook.github.io/draft-js/ Enter : foo bar bat. Highlight the whole line and the bold button will not be lit. Highlight "foo bar" and, again, bold is unlit. Highlight "bar bat" and bold will light, despite the fact that all the characters in the selection are not bold.

I'm seeing this in version 0.9.1

貢獻者指南