ampproject / ampproject/amphtml
[amp-story-interactive-img-quiz] & [amp-story-interactive-img-poll]: background-image property issue & gaps in between two options
- 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)

(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)

### 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
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