Cannot interact with "details" macro in post preview

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.

2 Likes
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.

1 Like

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.

4 Likes

Aha that is good to know cc @zogstrip

4 Likes

Just pushed a fix :cactus: The issue was that we were preventing all clicks in the preview…

https://github.com/discourse/discourse/commit/e848c336bbbebbe035a5998baded6fbb68a06037

3 Likes

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.

3 Likes

Nope. Polls use customized <li> elements :wink:

1 Like

This topic was automatically closed after 6 hours. New replies are no longer allowed.