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:
Toby Zerner 2017-11-07 21:12:03 +10:30
parent 091305cce2
commit b4375e4f7d
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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