Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus the search field when it's opened #1316

Merged
merged 12 commits into from Jun 12, 2019

Conversation

Projects
None yet
2 participants
@luontola
Copy link
Collaborator

commented Jun 4, 2019

Closes #1311

@Macroz
Copy link
Collaborator

left a comment

Is this the only way or would refs or autofocus work here?

@luontola

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 4, 2019

The problem with autofocus is that there can be only one element with that attribute on the page (we have multiple tables/searches on some pages), and it would also grab the focus when the page is loaded for the first time (after closing the search, the open-search button needs to be focused, but the open-search button is visible already on page load).

I can investigate using refs. It might be possible to use the refs as a kind of a callback for finding out when the element becomes visible, which would avoid the polling.

luontola added some commits Jun 5, 2019

Show resolved Hide resolved src/cljs/rems/focus.cljs Outdated
Show resolved Hide resolved src/cljs/rems/table.cljs
Show resolved Hide resolved src/cljs/rems/table.cljs Outdated

@luontola luontola requested a review from Macroz Jun 11, 2019

@Macroz

Macroz approved these changes Jun 12, 2019

@Macroz Macroz merged commit 09b54c8 into master Jun 12, 2019

7 checks passed

WIP Ready for review
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: doo Your tests passed on CircleCI!
Details
ci/circleci: ok Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: war Your tests passed on CircleCI!
Details
ci/circleci: without-db Your tests passed on CircleCI!
Details

@Macroz Macroz deleted the focus-search branch Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.