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

Prevent enter from doing a form submit on the filterable search #7240

Closed
itbeyond opened this Issue Mar 12, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@itbeyond

itbeyond commented Mar 12, 2014

A previous issue: prevent enter from doing a form submit on the list search filter #1068 has returned/resurfaced in 1.4.2 using the filterable widget brings this issue back where a Enter or [DONE] or [SEARCH] button on mobile devices causes the page to submit and reload. If the filterable is being used on a widget it should not submit.

Code used on my page that causes the issue in 1.4.2:

 <form class="ui-filterable">
                <input type="text" autocomplete="off" placeholder="Search for..." data-type="search" id="filterable-input" />
            </form>
            <ul id="wfList" data-filter="true" data-autodividers="true" data-input="#filterable-input" data-role="listview" data-filter-reveal="true" data-divider-theme="c"></ul>

The listview is built dynamically from AJAX and updated via refresh.

@itbeyond

This comment has been minimized.

Show comment
Hide comment
@itbeyond

itbeyond Mar 12, 2014

Sample using the above code and showing the error: http://jsfiddle.net/7V5sc/

itbeyond commented Mar 12, 2014

Sample using the above code and showing the error: http://jsfiddle.net/7V5sc/

gabrielschulhof added a commit that referenced this issue Mar 13, 2014

Filterable: Prevent form submission
Intercept ENTER on keydown and preventDefault()

Fixes gh-7240

@gabrielschulhof gabrielschulhof added this to the 1.4.3 milestone Mar 13, 2014

@gabrielschulhof gabrielschulhof self-assigned this Mar 13, 2014

gabrielschulhof added a commit that referenced this issue Mar 14, 2014

Filterable: Prevent form submission
Intercept ENTER on keydown and preventDefault()

Fixes gh-7240

gabrielschulhof added a commit that referenced this issue Mar 14, 2014

Filterable: Prevent form submission when user presses ENTER
Intercept ENTER on keydown and keypress, preventing default

Fixes gh-7240
@LeMee

This comment has been minimized.

Show comment
Hide comment
@LeMee

LeMee Sep 29, 2014

hello, unfortunately, there is not enough space on small screens to have both a search input (database query to search outside this page) and a filterable input field.
It could have been cool to have a kind of

data-prevent-submit="true" ?

I have to comment your change since 1.4.3.

LeMee commented Sep 29, 2014

hello, unfortunately, there is not enough space on small screens to have both a search input (database query to search outside this page) and a filterable input field.
It could have been cool to have a kind of

data-prevent-submit="true" ?

I have to comment your change since 1.4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment