Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Clarify comment above tryToRemoveBlockStyle
Browse files Browse the repository at this point in the history
Summary:
I found the comment above `RichUtils.tryToRemoveBlockStyle` a bit confusing while trying to understand the function's logic.

I would argue that the current comment's inclusion of information about where it is used is unnecessary, and makes it seem as if its interaction with those key commands was implemented inside the function itself.
Closes #1135

Differential Revision: D5477479

fbshipit-source-id: a8cee503bf5459c63ac58504f5c112a1a249b64a
  • Loading branch information
noahlemen authored and facebook-github-bot committed Jul 22, 2017
1 parent 33e1167 commit 643c388
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/model/modifier/RichTextEditorUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ const RichTextEditorUtil = {
},

/**
* When a collapsed cursor is at the start of an empty styled block, allow
* certain key commands (newline, backspace) to simply change the
* style of the block instead of the default behavior.
* When a collapsed cursor is at the start of an empty styled block,
* changes block to 'unstyled'. Returns null if block or selection does not
* meet that criteria.
*/
tryToRemoveBlockStyle: function(editorState: EditorState): ?ContentState {
var selection = editorState.getSelection();
Expand Down

0 comments on commit 643c388

Please sign in to comment.