ampproject / ampproject/amphtml

[amp-story-interactive-img-quiz] & [amp-story-interactive-img-poll]: background-image property issue & gaps in between two options

Open
#37,575 2 comments 0 reactions 0 assignees View on GitHub
Stale Type: Bug WG: stories
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

Two Issues for image quizzes and image polls:
(1) When we use an image URL consisting "()", the inline background-image CSS property does not auto generate to a resp. div element.
for e.g. If a option-1-image="http://example.com/uploads/named(41).jpg", the option grid show blank.
(For solution: The auto generated value of property is: url(http://example.com/uploads/named(41).jpg), instead those URLs must have to be within quotes like: url('http://example.com/uploads/named(41).jpg)')
Sample story example: [Check Slide No. 2](https://myampstories.visualstories.com/test-image-quiz)
![Background_Image_Issue](https://user-images.githubusercontent.com/24918880/152511088-4df61188-7992-4a4f-8c17-c7e9c1b82db5.PNG)

(2) When prompt text content is lesser than max-width decided to quiz/poll blocks while there is only two options exist, then there will be no margin-left space generates for 2nd option.
Sample story example: [Check Slide No. 3](https://myampstories.visualstories.com/test-image-quiz)
![Options_gap](https://user-images.githubusercontent.com/24918880/152511155-8990efab-052c-4c2a-b237-9f34b9526c72.PNG)

### Reproduction Steps

Please hit the shared story example links for references.

### Relevant Logs

_No response_

### Browser(s) Affected

Chrome, Firefox, Safari, Edge, UC Browser

### OS(s) Affected

_No response_

### Device(s) Affected

_No response_

### AMP Version Affected

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the amp-story-interactive-img-quiz and amp-story-interactive-img-poll components and reproduce both cases using the linked sample story, checking slides 2 and 3. Inspect how option-1-image is turned into an inline background-image and how two-option prompt spacing is calculated. Done means URLs containing parentheses render correctly and two short prompts retain a gap before the second option in both components.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.