mirror of
https://github.com/flarum/framework.git
synced 2025-03-03 23:07:56 +08:00
Force redraw of composer component when switching in a new one
This commit is contained in:
parent
c95b8838ac
commit
e272ae77e1
@ -213,6 +213,13 @@ class Composer extends Component {
|
|||||||
|
|
||||||
load(component) {
|
load(component) {
|
||||||
if (!this.preventExit()) {
|
if (!this.preventExit()) {
|
||||||
|
// If we load a similar component into the composer, then Mithril will be
|
||||||
|
// able to diff the old/new contents and some DOM-related state from the
|
||||||
|
// old composer will remain. To prevent this from happening, we clear the
|
||||||
|
// component and force a redraw, so that the new component will be working
|
||||||
|
// on a blank slate.
|
||||||
|
this.component = null;
|
||||||
|
m.redraw(true);
|
||||||
this.component = component;
|
this.component = component;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user