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:
Joffrey JAFFEUX
2023-10-25 22:50:32 +02:00
committed by GitHub
parent 619d709d54
commit becad4d7d7

View File

@@ -223,6 +223,10 @@ export default class PostTextSelection extends Component {
@bind
onSelectionChanged() {
if (this.isSelecting) {
return;
}
const { isIOS, isWinphone, isAndroid } = this.capabilities;
const wait = isIOS || isWinphone || isAndroid ? INPUT_DELAY : 25;
this.selectionChangeHandler = discourseDebounce(
@@ -233,25 +237,13 @@ export default class PostTextSelection extends Component {
}
@bind
mousedown(event) {
this.validMouseDown = true;
if (!event.target.closest(".cooked")) {
this.validMouseDown = false;
return;
}
mousedown() {
this.isSelecting = true;
}
@bind
mouseup() {
this.isSelecting = false;
if (!this.validMouseDown) {
return;
}
this.onSelectionChanged();
}