mirror of
https://github.com/excalidraw/excalidraw
synced 2025-07-25 13:58:22 +08:00
Compare commits
30 Commits
446f871536
...
zsviczian-
Author | SHA1 | Date | |
---|---|---|---|
13309a66c5 | |||
531829d95e | |||
d3cbceb7fa | |||
73111500d3 | |||
9e17b64e5e | |||
326da61573 | |||
994f2a3f1e | |||
5dbcf64353 | |||
eda2320dae | |||
b610c04481 | |||
d969849357 | |||
9a66fc6c05 | |||
158f169c43 | |||
ce27cb6159 | |||
2e04bcd485 | |||
7436f3926b | |||
e429b7048d | |||
e61b447413 | |||
73f0d854bf | |||
cec3cf8334 | |||
8640e75ccf | |||
ca7ce64fea | |||
e3a78fe5df | |||
554985f749 | |||
d3857fbb35 | |||
93c72cbb32 | |||
aeb4d39387 | |||
a0259360d6 | |||
243d8de7a8 | |||
81c927bab6 |
@ -63,6 +63,8 @@ export const ENV = {
|
||||
|
||||
export const CLASSES = {
|
||||
SHAPE_ACTIONS_MENU: "App-menu__left",
|
||||
SHAPE_ACTIONS_MOBILE_MENU: "App-mobile-menu",
|
||||
MOBILE_TOOLBAR: "App-toolbar-content",
|
||||
};
|
||||
|
||||
// 1-based in case we ever do `if(element.fontFamily)`
|
||||
|
@ -542,9 +542,29 @@ export const textWysiwyg = ({
|
||||
target.closest(".color-picker-input") &&
|
||||
isWritableElement(target);
|
||||
|
||||
const isShapeActionsPanel =
|
||||
(target instanceof HTMLElement || target instanceof SVGElement) &&
|
||||
(target.closest(`.${CLASSES.SHAPE_ACTIONS_MENU}`) ||
|
||||
target.closest(`.${CLASSES.SHAPE_ACTIONS_MOBILE_MENU}`) ||
|
||||
target.closest(`.${CLASSES.MOBILE_TOOLBAR}`));
|
||||
|
||||
setTimeout(() => {
|
||||
editable.onblur = handleSubmit;
|
||||
if (target && isTargetColorPicker) {
|
||||
editable.onblur = () => {
|
||||
app.setState({
|
||||
toastMessage:
|
||||
target instanceof HTMLElement
|
||||
? target.tagName ?? "no tagName"
|
||||
: "not an HTMLElement",
|
||||
});
|
||||
if (isShapeActionsPanel) {
|
||||
return;
|
||||
}
|
||||
app.setState({
|
||||
toastMessage: "debug: onblur",
|
||||
});
|
||||
handleSubmit();
|
||||
};
|
||||
if (target && (isTargetColorPicker || isShapeActionsPanel)) {
|
||||
target.onblur = () => {
|
||||
editable.focus();
|
||||
};
|
||||
@ -562,13 +582,22 @@ export const textWysiwyg = ({
|
||||
event.target instanceof HTMLInputElement &&
|
||||
event.target.closest(".color-picker-input") &&
|
||||
isWritableElement(event.target);
|
||||
const isShapeActionsPanel =
|
||||
(event.target instanceof HTMLElement ||
|
||||
event.target instanceof SVGElement) &&
|
||||
(event.target.closest(`.${CLASSES.SHAPE_ACTIONS_MENU}`) ||
|
||||
event.target.closest(`.${CLASSES.SHAPE_ACTIONS_MOBILE_MENU}`) ||
|
||||
event.target.closest(`.${CLASSES.MOBILE_TOOLBAR}`));
|
||||
if (
|
||||
((event.target instanceof HTMLElement ||
|
||||
event.target instanceof SVGElement) &&
|
||||
event.target.closest(`.${CLASSES.SHAPE_ACTIONS_MENU}`) &&
|
||||
isShapeActionsPanel &&
|
||||
!isWritableElement(event.target)) ||
|
||||
isTargetColorPicker
|
||||
) {
|
||||
app.setState({
|
||||
toastMessage: "debug: onPointerDown",
|
||||
});
|
||||
editable.onblur = null;
|
||||
window.addEventListener("pointerup", bindBlurEvent);
|
||||
// handle edge-case where pointerup doesn't fire e.g. due to user
|
||||
|
Reference in New Issue
Block a user