fix(feed): give the view switcher the keyboard model its menu role promises
Arrows/Home/End move a roving focus and Escape hands focus back to the trigger — the menu unmounts under the focused item, which stranded focus on <body>. Outside-click deliberately does not refocus: that would steal focus from whatever was just clicked.
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
export type FeedView = "cards" | "rows";
|
||||
|
||||
export const FEED_VIEWS: readonly FeedView[] = ["cards", "rows"] as const;
|
||||
export const FEED_VIEW_DEFAULT: FeedView = "cards";
|
||||
|
||||
export function isFeedView(v: unknown): v is FeedView {
|
||||
const FEED_VIEW_DEFAULT: FeedView = "cards";
|
||||
|
||||
function isFeedView(v: unknown): v is FeedView {
|
||||
return typeof v === "string" && (FEED_VIEWS as readonly string[]).includes(v);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user