WebUI: Turn off search feature via html "hidden" attribute instead of polymer dom-if template #3212
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.
Fix brave/brave-browser#5330
This fixes the issue with the downloads page due to a timing issue with the download item list rendering. That list uses iron-list via downloads/manager.html. The list will not render if the list component's element does not have either a width or a height (via flex, explicit css, or otherwise). In the course of the page load, there is specific timing where the page has width just before the items that are provided to the iron-list are rendered. This timing could definitely be improved upstream.
The download page asks the toolbar whether the search field is clear or not (so that the download page knew to render the entire list of downloads, or one filtered to the search term).
Somehow having an extra polymer template to ensure had rendered before our toolbar would return the correct value for this caused this timing to be off, and so when the iron-list was first rendered it did not do anything because there was no width or height to the element. At any time later, forcing the iron-list to re-evaluate it's rendering ability by resizing the window (since it subscribes directly to this event), or running
downloadsList.fire('iron-resize')
directly, would caus the list to render successfully.Interestingly, there is an attempt in the upstream code to force firing of this event to prevent this issue, but it actually happens too early, or rather it does not listen to all the properties that could cause this issue: https://cs.chromium.org/chromium/src/chrome/browser/resources/downloads/manager.js?rcl=044ab765751f0d98b0758a6de98265797ee67793&l=122
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
As well as verifying the downloads page list is fixed via brave/brave-browser#5330, we should also verify that the search box still hides / shows appropriately:
Search shows
brave://settings
Search does not show
brave://rewards
Reviewer Checklist:
After-merge Checklist:
changes has landed on.