This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Skip item element cache when search is preserved #105
Merged
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.
Description of the Change
This change works around an issue introduced in 0.43.0 which causes the
command palette to become unusable when the user enables the "Preserve
Last Search" setting and then searches a few times. This is caused by
the new item element caching logic which preserves items from previous
searches. Somehow these cached elements do not have their parentNode
set to the SelectListView causing the crash which breaks the command
palette.
This change is a temporary workaround to unblock the release of Atom
1.24 and 1.25-beta until the core issue can be addressed.
Related to atom/atom#16622.
Alternate Designs
Another approach was to add a null check around the use of
parentNode.replaceChild
in atom-select-list, but this caused other UX problems to occur. The better workaround is to avoid the broken elements to begin with. A real fix that addresses the core problem is still needed, but this change unblocks the release of 1.24 and 1.25-beta.Benefits
No more crashing command palette which can only be resolved by restarting Atom.
Possible Drawbacks
Reduced performance when "Preserve Last Search" is turned on.
Applicable Issues
atom/atom#16622
/cc @iolsen @lee-dohm @Ben3eeE @as-cii