feat(playlists): drag rows onto a list in the rail
A row's grip carries it, or every selected row with a selected one, onto another list, under a sort or a filter too, and the toast undoes. The rail and the page are separate React trees, so the page reads the rail by what lies under the pointer. An unpinned rail peeks by the drag's own hover and scrolls at its edges. Many rows dropped inside the list stay; a key still moves its own row.
This commit is contained in:
@@ -493,6 +493,16 @@ function refocusSlot(list: NavList, index: number, removed: HTMLElement): void {
|
||||
requestAnimationFrame(wait);
|
||||
}
|
||||
|
||||
/** The item holding `el` is leaving its list by other hands than Delete (a drag out of it): the focus
|
||||
* takes its slot all the same, not <body>. By element, as a click on a button leaves the focus
|
||||
* elsewhere in Safari. */
|
||||
export function followRemoval(el: Element): void {
|
||||
const item = el.closest<HTMLElement>(`[${INDEX}]`);
|
||||
const list =
|
||||
item && lists.get(item.parentElement?.closest<HTMLElement>(`[${LIST}]`) as HTMLElement);
|
||||
if (item && list) refocusSlot(list, indexOf(item), item);
|
||||
}
|
||||
|
||||
// ── The item a view was left from ────────────────────────────────────────────────────────────────
|
||||
// Opening something that switches the page or the view — a Plex title from Home's rail, a channel from
|
||||
// the Channels table — unmounts the list the keyboard was on, so Back used to hand focus to <body> and
|
||||
|
||||
Reference in New Issue
Block a user