kopia lustrzana https://github.com/cheeaun/phanpy
Fix undefined current.style
rodzic
a7aba451bc
commit
eab0d85842
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
}));
|
||||
|
||||
|
|
|
@ -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 ""
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue