Skip to content

Commit

Permalink
Merge pull request #390 from wordpress-mobile/issue/317-fixing-block-…
Browse files Browse the repository at this point in the history
…elements-selection-range

Issue/317 fixing block elements selection range
  • Loading branch information
0nko authored Jun 19, 2017
2 parents a22b37b + 411e85b commit d94be69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class BlockFormatter(editor: AztecText, val listStyle: ListStyle, val quoteStyle
}

applyBlock(spanToApply, startOfBlock, endOfBlock)
editor.onSelectionChanged(startOfLine, endOfLine)
editor.onSelectionChanged(editor.selectionStart, editor.selectionEnd)
}
}

Expand Down
7 changes: 1 addition & 6 deletions aztec/src/test/kotlin/org/wordpress/aztec/HeadingTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,7 @@ class HeadingTest {

toolbar.onMenuItemClick(menuHeading2)
Assert.assertEquals("<h1>Heading 1</h1><h2>Heading 2</h2><h3>Heading 3</h3>", editText.toHtml())
// TODO: Correct heading menu selection. This is incorrect. Heading 2 should be selected.
// AztecToolbar.highlightAppliedStyles returns Heading 1, Heading 2, and Heading 3 so then
// AztecToolbar.selectHeaderMenu selects the first format. See this issue for details.
// https://github.com/wordpress-mobile/AztecEditor-Android/issues/317
// Assert.assertEquals(TextFormat.FORMAT_HEADING_2, toolbar.getSelectedHeadingMenuItem())
Assert.assertEquals(TextFormat.FORMAT_HEADING_1, toolbar.getSelectedHeadingMenuItem())
Assert.assertEquals(TextFormat.FORMAT_HEADING_2, toolbar.getSelectedHeadingMenuItem())
}

@Test
Expand Down

0 comments on commit d94be69

Please sign in to comment.