When a menupopup is opened, the active element does not change, so
their focus-ring will be hidden until the menupopup closes for it to be
less distracting.
When a panel popup is opened, the focus will be moved inside
of the panel, so we keep track of whichever element was previously
focused, and re-focus it when the panel goes away.
Minor reorganization of focus-ring mixin to use variables instead
of parameters to make hiding of focus-ring easier.
Prevent trash/duplicated/unfiled/etc. rows from getting focused on Enter
if it is the currently selected collection row that technically
passes the filter and Enter is pressed.
Make sure that on escape, the focus is moved to collectionTree strictly
once all filtered rows are rendered. Minor refactoring to achieve
it, since setFilter is async.
Before filtering starts, save the selected row, scroll position, and
which rows were collapsed before filering, and restore them once the
filtering is over if a row was focused during filtering.
Ideally we should cache these/not recreate the menuitems every time, or
something like that, so that localization pop-in doesn't happen at all. But a
brief flash of an empty menuitem is better than a brief flash of placeholder
text.
To preserve the proper scroll behavior to top pane/pinned pane on item
change, remember which pane needs to be scrolled to when itemPane is
collapsed, and scroll to it when the itemPane is expanded.
- Remove margins and add a border to the pseudo-element.
It improves how the text of the pseudo-component matches the text from
textarea and should prevent the scrollbar from appearing due to mismatch.
- Swap explicit width setting for editable-text in itemBox for
min-width: 0. It still allows the editable-text to be shrunk when the
itemBox is narrow but does not cause mismatches between pseudo elements
and the textarea.
We don't have to deal with background images attached to various parts of the
button like we did on macOS before, so we can just flip the icon and be done
with it.