Poll height on mobile with image content

AI-generated summary

The discussion is about the fixed height style for polls on mobile when there is image content inside the poll options causing layout issues.

DeanMarkTaylor originally raised the issue of polls not fitting on mobile in /t/-/28413 and suggested removing the height style. zogstrip said the height is there to keep poll height consistent and couldn’t reproduce.

DeanMarkTaylor then reproduced it on try.discourse showing how different image heights cause problems.

zogstrip said whitelisting allowed elements in polls and probably only allow emojis.

DeanMarkTaylor explained they use polls for voting on images of cars so names wouldn’t work well.

codinghorror suggested using image links above poll options.

cpradio noted vBulletin used to do this.

DeanMarkTaylor said that doesn’t work well for cars without names.

codinghorror said allowing images in polls is too problematic.

DeanMarkTaylor asked if calculating height when images loaded could fix it.

Continuing the discussion from Polls don't fit on mobile:

I’ve just reproduced this issue on try.discourse.org (obviously it’s likely to be reset soon):
http://try.discourse.org/t/poll-test-looking-into-images-in-polls/323

Screen grab:

Here is the relevant post raw code I used:

[poll name=with_content]
- My first image <img src="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/7/2/72d2687d1d00c52c546727efbbc6d726f6e153de.png" height="100">
- Emoji: :smile: 
[/poll]

[poll name=with_content2]
- My first image <img src="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/7/2/72d2687d1d00c52c546727efbbc6d726f6e153de.png" height="150">
- Emoji: :smile: 
[/poll]
[poll name=with_content3]
- My first image <img src="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/7/2/72d2687d1d00c52c546727efbbc6d726f6e153de.png">
- Emoji: :smile: 
[/poll]

I have on my TODO list to whitelist elements available inside poll options and the more I think about it, the less likely I am to whitelist images and links. Right now, I’m thinking only allowing emojis.

On one of the forums polls currently specifically for voting for images of cars - without images polls would be useless to me (that forum).

It works well without the fixed height style attribute.

1 me gusta

Not so, you could do this

Image of cat named Tiger

Image of cat named Fluffy

Image of cat named Lady

[ Poll ]

  • Vote for Tiger
  • Vote for Fluffy
  • Vote for Lady

I agree that allowing images inside the buttons is a whole can of worms we don’t want to get into

2 Me gusta

That is actually what we used to do on vBulletin. Post the images above and poll below it for them to choose which they liked best (the images were never part of the poll itself)

1 me gusta

We tried this - it doesn’t work well as cars don’t have names - it gives a bad user experience saying “A”, “B”, “C” - clicking images is best.

Too problematic for layout – sorry.

Is it possible to use something like this to get the correct height when the images are loaded?