InternationalScratchWiki / InternationalScratchWiki/mw-ScratchBlocks4

Not properly showing with dynamic previewing

Open
#12 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
10
Forks
11
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce:
1. Go to settings -> editing and enable "Show previews without reloading the page"
2. Edit a page with scratchblocks
3. Hit "Show Preview"
4. Change the content blocks
5. Hit "Show Preview" a second time
6. Notice that the blocks did not render

### Solution:
Trigger a render when live previews are generated. A hacky solution would be to just add an event listener to the "Show Preview" button, but a better solution would be to see if there are any JS events fired or something. [MW documentation](https://www.mediawiki.org/wiki/Manual:Live_preview) seems to indicate there is a "wikipage.content" hook we can use.

Example code from MW for the hook is:
```
mw.hook( 'wikipage.content' ).add( fn ).remove( fn );
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.