focus is currently a ton of boolean flags all over the place. This is difficult because parent components sometimes need to trigger focus in child components, so we need several booleans for focus and focus_input, etc. Instead we should have a single focus enum which is shared between most components. E.g.
we could get more fine-tuned w/ 'search:input' | 'search:suggestions' ...etc but that requires labeling reused components like search/tag.svelte.
Controlling focus from a parent component can be done by bind:this on child components and declaring functions as consts. We should be able to call them like search_el.focus() (which would call tag_search_el.focus())
[edit] we need a "focus stack" because if Im focused on the "Add New Tags" dialogue and I hit Escape, I need to know if I should return focus to the media_file or the thumbnail_grid
focus is currently a ton of boolean flags all over the place. This is difficult because parent components sometimes need to trigger focus in child components, so we need several booleans for
focus
andfocus_input
, etc. Instead we should have a single focus enum which is shared between most components. E.g.const focus: 'thumbnail-grid' | 'media_reference' | 'search'
we could get more fine-tuned w/
'search:input' | 'search:suggestions'
...etc but that requires labeling reused components likesearch/tag.svelte
.Controlling focus from a parent component can be done by
bind:this
on child components and declaring functions as consts. We should be able to call them likesearch_el.focus()
(which would calltag_search_el.focus()
)