Cannot interact with "details" macro in post preview


(Barry van Oudtshoorn) #1

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.


(Eli the Bearded) #2
Works for me

What have you tried on what browser and what happened?


(Barry van Oudtshoorn) #3

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?


(Eli the Bearded) #4

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.


(Barry van Oudtshoorn) #5

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.


Details Tags Not Working in Firefox?
(Jeff Atwood) #6

Aha that is good to know cc @zogstrip


(Régis Hanol) #7

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


(cpradio) #8

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.


(Régis Hanol) #9

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


(Régis Hanol) #10

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