mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(tap): fire input behavior when tap/clicking file input label. Closes #1699
This commit is contained in:
@@ -168,6 +168,15 @@
|
||||
<option>United States</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="item item-divider">
|
||||
File Input
|
||||
</div>
|
||||
<label class="item item-input">
|
||||
<div class="input-label">
|
||||
<i class="icon ion-document-text"></i> File
|
||||
</div>
|
||||
<input type="file"/>
|
||||
</label>
|
||||
|
||||
<div class="item item-divider">
|
||||
Other Tests
|
||||
|
||||
@@ -746,6 +746,24 @@ describe('Ionic Tap', function() {
|
||||
expect( ionic.tap.requiresNativeClick( div5 ) ).toEqual(true);
|
||||
});
|
||||
|
||||
it('Should ionic.tap.requiresNativeClick for labels containing input[file]', function() {
|
||||
var lbl = document.createElement('label');
|
||||
var ele = document.createElement('input');
|
||||
ele.type = 'file';
|
||||
lbl.appendChild(ele);
|
||||
expect( ionic.tap.requiresNativeClick( lbl ) ).toEqual(true);
|
||||
});
|
||||
|
||||
it('Should ionic.tap.requiresNativeClick for elements underneath labels containing input[file]', function() {
|
||||
var lbl = document.createElement('label');
|
||||
var txt = document.createElement('span');
|
||||
var ele = document.createElement('input');
|
||||
ele.type = 'file';
|
||||
lbl.appendChild(ele);
|
||||
lbl.appendChild(txt);
|
||||
expect( ionic.tap.requiresNativeClick( txt ) ).toEqual(true);
|
||||
});
|
||||
|
||||
it('Should not allow a click that has an textarea target but not created by tapClick', function() {
|
||||
var e = {
|
||||
target: document.createElement('textarea'),
|
||||
|
||||
Reference in New Issue
Block a user