mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 08:22:41 +08:00
Fix Composer textarea losing its height across route changes
There is a Mithril bug which causes context.retain to be ineffective for children nodes. https://github.com/MithrilJS/mithril.js/issues/1300 Thus, we have to assume that the children nodes (like the textarea) may be recreated and thus we need to update its height on each redraw. fixes #948
This commit is contained in:
parent
091305cce2
commit
b4375e4f7d
4
framework/core/js/forum/dist/app.js
vendored
4
framework/core/js/forum/dist/app.js
vendored
@ -19820,6 +19820,10 @@ System.register('flarum/components/Composer', ['flarum/Component', 'flarum/utils
|
||||
defaultHeight = this.$().height();
|
||||
}
|
||||
|
||||
// Set the height of the Composer element and its contents on each redraw,
|
||||
// so that they do not lose it if their DOM elements are recreated.
|
||||
this.updateHeight();
|
||||
|
||||
if (isInitialized) return;
|
||||
|
||||
// Since this component is a part of the global UI that persists between
|
||||
|
@ -91,6 +91,10 @@ class Composer extends Component {
|
||||
defaultHeight = this.$().height();
|
||||
}
|
||||
|
||||
// Set the height of the Composer element and its contents on each redraw,
|
||||
// so that they do not lose it if their DOM elements are recreated.
|
||||
this.updateHeight();
|
||||
|
||||
if (isInitialized) return;
|
||||
|
||||
// Since this component is a part of the global UI that persists between
|
||||
|
Loading…
x
Reference in New Issue
Block a user