Compare commits

...

30 Commits

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