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

Commit c924ed4

Browse files
Prevent the slider number input from being wrapped in a div.
1 parent 70103a5 commit c924ed4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

js/widgets/forms/textinput.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ $.widget( "mobile.textinput", $.mobile.widget, {
3535
clearbtn,
3636
clearBtnText = o.clearSearchButtonText || o.clearBtnText,
3737
clearBtnBlacklist = input.is( "textarea, :jqmData(type='range')" ),
38-
inputNeedsClearBtn = !!o.clearBtn && !clearBtnBlacklist;
38+
inputNeedsClearBtn = !!o.clearBtn && !clearBtnBlacklist,
39+
inputNeedsWrap = input.is( "input" ) && !input.is( ":jqmData(type='range')" );
3940

4041
function toggleClear() {
4142
setTimeout( function() {
@@ -64,7 +65,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
6465
//"search" and "text" input widgets
6566
if ( isSearch ) {
6667
focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield" + themeclass + miniclass + "'></div>" ).parent();
67-
} else if ( input.is( "input" ) ) {
68+
} else if ( inputNeedsWrap ) {
6869
focusedEl = input.wrap( "<div class='ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + miniclass + "'></div>" ).parent();
6970
}
7071

@@ -91,7 +92,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
9192

9293
input.bind( "paste cut keyup focus change blur", toggleClear );
9394
}
94-
else if ( input.is( "textarea" ) ) {
95+
else if ( !inputNeedsWrap && !isSearch ) {
9596
input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
9697
}
9798

0 commit comments

Comments
 (0)