MyBB Community Forums

Full Version: "Click to edit" is added to empty messages.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, the following text is added to messages with empty content (feature added from a plugin).

You can see the issue in the following test page:
https://ougc.network/entry?other-test-plugin

I tracked the issue to the following line:
https://github.com/mybb/mybb/blob/41fc42...min.js#L38

This isn't present in the default theme.

Does some JavaScript guru knows how to fix this or at least what exactly is causing it? I think it has to do with element identifies (class name, id, etc) and possibly order of elements, but I have no real clue.
I think this is the correct behaviour of jeditable. When there is no content placeholder is used. You can override default options when .editable() is called: https://github.com/mybb/mybb/blob/aaceba...ad.js#L186
You are right, adding placeholder: '', around the following line fixes the issue:
https://github.com/mybb/mybb/blob/aaceba...#L188-L196

I think a language string should at least be added for this. Maybe the options should be set within the templates, not just for this but other JS cases around the code, where editing JS is necessary to apply specific changes (add CSS classes to hard coded HTML, for example).