Compare commits

...

30 Commits

Author SHA1 Message Date
13309a66c5 Update textWysiwyg.tsx 2022-03-14 07:15:21 +01:00
531829d95e Update textWysiwyg.tsx 2022-03-14 07:11:12 +01:00
d3cbceb7fa Update textWysiwyg.tsx 2022-03-13 23:45:03 +01:00
73111500d3 Update textWysiwyg.tsx 2022-03-13 23:43:03 +01:00
9e17b64e5e Update textWysiwyg.tsx 2022-03-13 23:38:54 +01:00
326da61573 Update textWysiwyg.tsx 2022-03-13 23:36:05 +01:00
994f2a3f1e Update textWysiwyg.tsx 2022-03-13 23:30:43 +01:00
5dbcf64353 Update textWysiwyg.tsx 2022-03-13 23:25:37 +01:00
eda2320dae Update textWysiwyg.tsx 2022-03-13 23:17:19 +01:00
b610c04481 Update textWysiwyg.tsx 2022-03-13 23:04:22 +01:00
d969849357 Update textWysiwyg.tsx 2022-03-13 23:01:04 +01:00
9a66fc6c05 Update textWysiwyg.tsx 2022-03-13 22:49:14 +01:00
158f169c43 Update textWysiwyg.tsx 2022-03-13 22:28:37 +01:00
ce27cb6159 Update textWysiwyg.tsx 2022-03-13 22:23:08 +01:00
2e04bcd485 Update textWysiwyg.tsx 2022-03-13 21:59:07 +01:00
7436f3926b debug iOS 2022-03-13 21:55:21 +01:00
e429b7048d Update textWysiwyg.tsx 2022-03-11 13:44:25 +01:00
e61b447413 Update textWysiwyg.tsx 2022-03-11 13:39:19 +01:00
73f0d854bf Update MobileMenu.tsx 2022-03-11 13:34:42 +01:00
cec3cf8334 Update textWysiwyg.tsx 2022-03-11 13:33:15 +01:00
8640e75ccf Update constants.ts 2022-03-11 13:28:21 +01:00
ca7ce64fea Update MobileMenu.tsx 2022-03-11 12:02:07 +01:00
e3a78fe5df Update MobileMenu.tsx 2022-03-11 11:49:18 +01:00
554985f749 Update MobileMenu.tsx 2022-03-11 11:46:53 +01:00
d3857fbb35 Update MobileMenu.tsx 2022-03-11 11:41:49 +01:00
93c72cbb32 Update MobileMenu.tsx 2022-03-11 11:21:55 +01:00
aeb4d39387 Update MobileMenu.tsx 2022-03-11 11:18:20 +01:00
a0259360d6 Update MobileMenu.tsx 2022-03-11 11:15:24 +01:00
243d8de7a8 Update MobileMenu.tsx 2022-03-11 11:12:50 +01:00
81c927bab6 Update MobileMenu.tsx 2022-03-11 11:07:28 +01:00
2 changed files with 34 additions and 3 deletions

View File

@ -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)`

View File

@ -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