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

Search field auto-focus #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Search field auto-focus #64

wants to merge 2 commits into from

Conversation

theodorejb
Copy link
Contributor

Added an input option to auto-focus the search field.

@@ -1254,6 +1255,10 @@
text: settings.inputs.searchText
}).append($search);

if (settings.inputs.searchAutofocus) {
$($search).attr('autofocus', 'autofocus');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using jQuery, we would generally use the prop function rather than the attr function for this. Also, the $search element is already a jQuery element, so it doesn't need to be re-wrapped. Probably instead use something like:

$search.prop('autofocus', true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants