mirror of
https://github.com/discourse/discourse.git
synced 2024-11-21 16:38:15 -06:00
FIX: cancel post toolbar on click outside (#23546)
On `mousedown` if the click is outside a cooked element cancel the `mousedown`/`mouseup` sequence and only rely on the `selectionchange` event. This change ensures a click on avatar for example will work, even if user is doing a rather slow click (meaning: the mousedown has been hold for more than 100ms).
This commit is contained in:
parent
9ac5e09179
commit
a32fa3b947
@ -233,9 +233,14 @@ export default class PostTextSelection extends Component {
|
||||
}
|
||||
|
||||
@bind
|
||||
async mousedown() {
|
||||
this.isMousedown = true;
|
||||
mousedown(event) {
|
||||
this.holdingMouseDown = false;
|
||||
|
||||
if (!event.target.closest(".cooked")) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isMousedown = true;
|
||||
this.holdingMouseDownHandler = discourseLater(() => {
|
||||
this.holdingMouseDown = true;
|
||||
}, 100);
|
||||
|
Loading…
Reference in New Issue
Block a user