Screenshots
After re-opening the form
Bug description
- Open the "advanced parameters".
- Select a file type, e.g. "jpg".
- Enter either a with, height, or both. Make sure you enter numbers with more than one digit, e.g. "123".
- Submit.
- Notice the URL contains search=…+filew:>123&…. This is correct and the reason why the search result is the expected one.
- But the URL also contains advancedSearch-current={"options":{"filew":[">":"1"]}}. The number here is truncated and only shows the first digit.
- This is reflected in the form.
Adding one more observation:
- the information is lost in the form so if we would conduct a new search we'd get different results.
I tried to dig into this and found that all change events except the first one are lost on all 4 file width/height input elements.
Note
- The two affected fields (ImageDimensionInput) are homebrewn fields that consist of 2 other OOUI elements
- There is code in ImageDimensionInput that tries to connect the change events of the two operatorInput and valueInput to properly propagate to the store.
- The change event seems to only listen to the first input, not to any changes after that. However, the correct value appears in the url.
- There are no unit tests for ImageDimensionInput so far, and they should definitely be added
AcceptanceCriteria
When a number like "1234" is entered into the px field, and then we search,
- the search results should be correct
- the search form should still have the same number in the px field
- there should not be any new params in the search bar
- the url should not have any unexpected parameters
- this should work for all px fields in all combinations