Skip to content

Commit ece0cde

Browse files
committed
Disallow editing by selection dragging when not editable.
Fixes #156.
1 parent 07fc7a1 commit ece0cde

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

richtextfx/src/main/java/org/fxmisc/richtext/skin/StyledTextAreaBehavior.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ private void mousePressed(MouseEvent e) {
424424
private void firstLeftPress(CharacterHit hit) {
425425
clearTargetCaretOffset();
426426
IndexRange selection = area.getSelection();
427-
if(selection.getLength() != 0 &&
427+
if(area.isEditable() &&
428+
selection.getLength() != 0 &&
428429
hit.getCharacterIndex() >= selection.getStart() &&
429430
hit.getCharacterIndex() < selection.getEnd()) {
430431
// press inside selection

0 commit comments

Comments
 (0)