Workaround for new Boostrap-vue when editor became zombie
See original GitHub issueThe current behavior is described in detail in #106 and #113: Editor get loaded correctly on first time it is shown, then second and later on it became blank / disabled / zombie / frozzen / etc.
The description of the real internal problem is also in those tickets. I want to show you my workaround, ugly but functional: reloading the component with v-if. Yes, it’s not the best, but it works.
Here is it the component used:
<b-modal ref="modal_editor">
<vue-mce v-if="show_editor" :config="config_mce" v-model="content"/>
</b-modal>
The magic code:
forceRerender () {
this.show_editor = false;
this.$nextTick(() => { this.show_editor = true })
},
How to use it:
this.forceRerender()
this.$refs.modal_editor.show()
The rerender function (and other options that didn’t work this time) comes from the following reference: https://michaelnthiessen.com/force-re-render/
My environment: “bootstrap”: “^4.4.1”, “bootstrap-vue”: “^2.5.0”, “tinymce”: “^5.1.1”, “vue”: “^2.6.11”, “vue-mce”: “^1.5.3”,
Regards.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Getting Started | BootstrapVue
Get started with BootstrapVue, based on the world's most popular framework - Bootstrap v4, for building responsive, mobile-first sites using Vue.js.
Read more >Getting started with BootstrapVue
Recently, a new package was released in the Vue.js ecosystem. It is an integration of the popular Bootstrap framework and Vue.js.
Read more >What Is EXC_BAD_ACCESS and How to Debug It - Code
I will also give you a few tips to fix bugs that are caused by ... In Xcode, you can enable zombie objects,...
Read more >#CUC18 | All Sessions
Whether you recently launched a new web presence or you are embarking on the ... How we learned to stop worrying and embrace...
Read more >Just build io
Details: fortnite editing simulator, just build lol un, unblocked games just ... Build Royale io is new game in Battle Royale style where...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
working (and easy) solution from the bootstrap-vue github: https://github.com/bootstrap-vue/bootstrap-vue/issues/4537#issuecomment-580133825
Hi @hgc2002
I’m a bit late in chiming in with workaround but if I may suggest key changing as part of the modal showing to ensure that the component is re-rendered whenever you open the modal. E.G.
When the modal opens it will trigger the
@shown
behaviour calling the render function:By having a new key Vue will force the re-rendering of the component.
Let me know if this works for your use case.