FIX: do not check if inside cooked early (#24105)
We already do this check inside `selectionChanged` and this was preventing us to correctly set `isSelecting` to true. This was causing issues when starting your selection from outside cooked.
This commit is contained in:
parent
619d709d54
commit
becad4d7d7
|
@ -223,6 +223,10 @@ export default class PostTextSelection extends Component {
|
||||||
|
|
||||||
@bind
|
@bind
|
||||||
onSelectionChanged() {
|
onSelectionChanged() {
|
||||||
|
if (this.isSelecting) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { isIOS, isWinphone, isAndroid } = this.capabilities;
|
const { isIOS, isWinphone, isAndroid } = this.capabilities;
|
||||||
const wait = isIOS || isWinphone || isAndroid ? INPUT_DELAY : 25;
|
const wait = isIOS || isWinphone || isAndroid ? INPUT_DELAY : 25;
|
||||||
this.selectionChangeHandler = discourseDebounce(
|
this.selectionChangeHandler = discourseDebounce(
|
||||||
|
@ -233,25 +237,13 @@ export default class PostTextSelection extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bind
|
@bind
|
||||||
mousedown(event) {
|
mousedown() {
|
||||||
this.validMouseDown = true;
|
|
||||||
|
|
||||||
if (!event.target.closest(".cooked")) {
|
|
||||||
this.validMouseDown = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.isSelecting = true;
|
this.isSelecting = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bind
|
@bind
|
||||||
mouseup() {
|
mouseup() {
|
||||||
this.isSelecting = false;
|
this.isSelecting = false;
|
||||||
|
|
||||||
if (!this.validMouseDown) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.onSelectionChanged();
|
this.onSelectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue