Workaround for new Boostrap-vue when editor became zombie

Open
#131 9 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #496 by @ELHart05 — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
frontend

Research direction

Start with the related issues #106 and #113 for the reported repeated-use failure, then review the open pull request #496 before considering any work. The issue describes a Vue modal containing vue-mce and a rerender workaround; done means the editor works on later openings without becoming blank or disabled.

Written by the indexing model from the issue text.

Description

status: escalated

The 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.

Dominant language
TypeScript
Stars
2.2k
Forks
217
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tinymce/tinymce-vue

All issues in tinymce/tinymce-vue

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.