Open BennyThink opened 10 months ago
it seems this file src/util/focusEditableElement.ts
if (!IS_TOUCH_ENV && !forcePlaceCaretAtEnd && (!lastChild || !lastChild.nodeValue)) {
requestMeasure(() => element.focus());
return;
}
requestMeasure
is incompatible with Safari. If I change it back to element.focus()
then everything works fine.
Or !IS_TOUCH_ENV && !IS_SAFARI &&...
to make an exemption for Safari.
I will open an PR for this. But feel free to ignore it or fix it in a better way.
Hello, can you check if changing requestMeasure → forceMeasure
works?
Sure, I'll check it tonight and get back to you
Sadly no.
import { requestMeasure, forceMeasure } from "../lib/fasterdom/fasterdom";
.....
if (!IS_TOUCH_ENV && !IS_SAFARI && !forcePlaceCaretAtEnd && (!lastChild || !lastChild.nodeValue)) {
forceMeasure(() => element.focus());
return;
}
Error traceback
ERROR
The current phase is 'measure'
forceMeasure@http://localhost:1234/main.9eff3f8863b471f912aa.js:19731:20
focusEditableElement@http://localhost:1234/src_components_common_Audio_tsx-src_components_common_AvatarList_tsx-src_components_common_Ch-2ffb91.e02e99f3be186cb67f16.js:19119:75
handleChange@http://localhost:1234/src_components_common_Audio_tsx-src_components_common_AvatarList_tsx-src_components_common_Ch-2ffb91.e02e99f3be186cb67f16.js:10556:79
handleEvent@http://localhost:1234/main.9eff3f8863b471f912aa.js:20217:16
Yes, I can confirm that forceMeasure doesn't work for safari either, with error message:
Shoot!
Something went wrong, please see the error details in Dev Tools Console.
The current phase is 'measure'
forceMeasure@http://localhost:1234/main.89c43f59d6e982381259.js:19731:20
focusEditableElement@http://localhost:1234/src_components_common_Audio_tsx-src_components_common_AvatarList_tsx-src_components_common_Ch-87f52f.04a4e94a3b58e109d040.js:18657:75
@http://localhost:1234/src_components_common_Audio_tsx-src_components_common_AvatarList_tsx-src_components_common_Ch-87f52f.04a4e94a3b58e109d040.js:10127:75
Chrome and Firefox works fine, bu not for Safari. See attach video for detail
Safari Version 16.5.2 (18615.2.9.11.10) macOS Ventura 13.4.1 (c)
Telegram Web A 10.0.0
EDIT: it works fine before today's update
https://github.com/Ajaxy/telegram-tt/assets/14024832/9e58c106-056c-47b5-b117-88d094da0259