Fix undefined current.style

pull/1254/head
Lim Chee Aun 2025-08-30 23:12:10 +08:00
rodzic a7aba451bc
commit eab0d85842
3 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -107,7 +107,8 @@ const Textarea = forwardRef((props, ref) => {
// Get height of textarea, set height to textExpander
if (textExpanderRef.current) {
const { height } = textarea.getBoundingClientRect();
textExpanderRef.current.style.height = height + 'px';
// textExpanderRef.current.style.height = height + 'px';
textExpanderRef.current.setStyle({ height: height + 'px' });
}
});
resizeObserver.observe(textarea);

Wyświetl plik

@ -47,6 +47,11 @@ function TextExpander({ onTrigger = null, ...props }, ref) {
// Expose the activated state to parent components
useImperativeHandle(ref, () => ({
setStyle: (style) => {
if (textExpanderRef.current) {
Object.assign(textExpanderRef.current.style, style);
}
},
activated: () => hasTextExpanderRef.current,
}));

2
src/locales/en.po wygenerowano
Wyświetl plik

@ -1245,7 +1245,7 @@ msgid "Bookmarks"
msgstr ""
#: src/components/nav-menu.jsx:244
#: src/components/text-expander.jsx:208
#: src/components/text-expander.jsx:213
msgid "More…"
msgstr ""