Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

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

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

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

itbeyond opened this issue Mar 12, 2014 · 2 comments
Assignees
Milestone

Comments

@itbeyond
Copy link

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
Copy link
Author

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

gabrielschulhof pushed a commit that referenced this issue Mar 13, 2014
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 pushed a commit that referenced this issue Mar 14, 2014
Intercept ENTER on keydown and preventDefault()

Fixes gh-7240
gabrielschulhof pushed a commit that referenced this issue Mar 14, 2014
Intercept ENTER on keydown and keypress, preventing default

Fixes gh-7240
@LeMee
Copy link

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants