Fix for crashes when grid images are wider than the screen #2673
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Basic fix for this issue. Essentially, forms will crash if the image for a grid select view is wider in pixels than the native display.
Release Note:
Feature Flag
It is specific to an uncommon pattern involving the use of the
compact
attribute on<select>
and<select1>
questions with images on the select items, which displays a grid of images to choose from.Product Description
N/A
Safety Assurance
Automated test coverage
I think we should consider seeing if we could usefully automate some tests around the image grid selection if we don't have them currently, as the project reporting this issue is quite high-value and high-impact, and they use the 'grid' pattern images in multiple places. Testing image widths and how the screen changes would be a valuable component of those tests.
Safety story
This fix has been tested locally after replicating the original issue. There's very small risk of introducing a regression due to the limited scope of the change.