It doesn’t appear to be possible to interact with [details] macros in the preview when composing a topic. You can interact with spoiler text, though. This is an issue where you’re composing a post which includes a lot of information in a [details] macro – like a long list – as you can’t ensure that you’ve got it right prior to publication without temporarily removing or “breaking” the [details] macro.
AI-generated summary
barryvan reported an issue where [details] macros are non-interactive in the post preview pane, making it difficult to verify content before publishing. While the feature works in saved posts and in older browsers like Edge, it fails in Firefox 49 and Chrome 54 Canary. barryvan hypothesized that the issue stems from a conflict between native <details> element support in newer Firefox versions and Discourse’s legacy JavaScript event handlers. elijah initially questioned the setup but later confirmed it worked in Firefox 46 and 47, supporting the theory that the bug is specific to the newer browser versions. codinghorror acknowledged the findings and pinged zogstrip. zogstrip subsequently identified the root cause as a script preventing all clicks within the preview area and pushed a fix to the repository. When cpradio asked if polls might be affected by similar click restrictions, zogstrip clarified that polls utilize customized <li> elements and are not impacted by the previous limitation.
Works for me
What have you tried on what browser and what happened?
Works for me in the posts once saved, but not in preview.
Works in:
- Edge 25.10586
Doesn’t work in:
- Firefox 49 (Developer Edition)
- Chrome 54 (Canary)
It looks as though this is built using the <details> element, which has just been preffed on in Firefox 49.
In Edge, which doesn’t natively support the behaviour of <details> and <summary>, there are click and keydown event handlers attached to the <summary> element. Are these handlers perhaps being inappropriately attached in Firefox and Chrome in the preview mode, resulting in double-handling of the behaviour? Or are they perhaps not being attached at all, and a browser bug in both Firefox and Chrome means these elements don’t behave as expected in the preview’s context?
I’ve seen it working in the preview area in all recent Firefox. But I’m not running a bleeding edge. I’ve tested today with FF 46 and 47.
Yeah – my guess is that this is a bug related to the fact that the <details> element is now fully supported from Firefox 49; it’s likely that Discourse is applying a workaround for older versions which will no longer be relevant when Fx49 reaches stable in a month or two.
Aha that is good to know cc @zogstrip
Just pushed a fix
The issue was that we were preventing all clicks in the preview…
https://github.com/discourse/discourse/commit/e848c336bbbebbe035a5998baded6fbb68a06037
Do polls use links for their clicks? Might be something to test if it doesn’t. Not sure you want people clicking that in the Preview window.
Nope. Polls use customized <li> elements ![]()
This topic was automatically closed after 6 hours. New replies are no longer allowed.