feat(web): focus on face-editor search input#27136
Open
cratoo wants to merge 4 commits intoimmich-app:mainfrom
Open
feat(web): focus on face-editor search input#27136cratoo wants to merge 4 commits intoimmich-app:mainfrom
cratoo wants to merge 4 commits intoimmich-app:mainfrom
Conversation
| }; | ||
|
|
||
| const focusSearchInput = () => { | ||
| searchContainerEl?.querySelector('input')?.focus(); |
Member
There was a problem hiding this comment.
Can't you bind: to the Input directly?
Contributor
Author
There was a problem hiding this comment.
Yeah sure, you're right. But shall I only move it to the Input or also get rid of the focusSearchInput() altogether and call it inline in the mount and the effect?
As said in the description at the first glance it felt more consistent to the other parts, but maybe I was mislead there are too many superfluous parts in there now.
Member
There was a problem hiding this comment.
I would probably just inline it
Contributor
Author
There was a problem hiding this comment.
Bind now on input and inlined it. Thanks for your feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
To further optimize #26826 the face-search input now is focused when opened. Also ensured to keep the focus on the search if the face-box is moved or resized (which most likely will always happen). Escape-key handling is also kept, so one can still close the face-editor.
How Has This Been Tested?
Screenshots (if appropriate)
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
AI was used to check codebase, if there are other ways to do focus-related things. As per my understanding the approach with svelte-tick is used in similar cases.