jQuery手机:ui-helper-hidden-accessible [英] jQuery mobile : ui-helper-hidden-accessible
问题描述
< div data-role =fieldcontainid =containsdivclass =no-field-separator>
< label for =field1class =ui-hidden-accessible>至< / label>
< input type =searchname =field1id =field1autocorrect =offautocapitalize =offautocomplete =offplaceholder =Field#1? value =/>
< input type =hiddenid =field1valname =field1val/>
< / div>
在DOM中,由jQUery mobile处理后,插入了follwing元素。 b
$ b
< span role =statusaria-live =politeclass =ui-helper-hidden-可访问的>< /跨度>
在我的搜索 input
和我隐藏的 input
。
当用户键入我的搜索输入时,我会做一些操作,并更新隐藏字段。
在这种情况下,我注意到这个跨度(类为 我不确定发生了什么,或者是由什么触发的。 调查发现: 这个目的字段实际上是隐藏但仍然可以访问,但是,这似乎并非如此 - 它在浏览器中呈现为可见。 一种禁止jQuery在我的表单中创建此元素的方法? ui-helper-hidden-accessible $ c
$ b
http://forum.jquery.com/topic/ui-helper-hidden-accessible-change
$(.selector =h2_lin>解决方案
focus:function(event,ui){
$(。ui-helper-hidden-accessible)。hide();
event.preventDefault();
}
});
In my html code:
<div data-role="fieldcontain" id="containdiv" class="no-field-separator">
<label for="field1" class="ui-hidden-accessible">To</label>
<input type="search" name="field1" id="field1" autocorrect="off" autocapitalize="off" autocomplete="off" placeholder="Field #1?" value="" />
<input type="hidden" id="field1val" name="field1val"/>
</div>
In the DOM, after being processed by jQUery mobile, has inserted the follwing element
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
In between my search input
and my hidden input
.
As the user types in my search input, I do some stuff, and update the value of the hidden field with it.
As this happens, I notice that this span (with class "ui-helper-hidden-accessible
") has its content updated with the value of the hidden input.
I am not sure what is happening, or what this is triggered by.
Investigating, I have found that: http://forum.jquery.com/topic/ui-helper-hidden-accessible-change
The purpose of this field is actually for it to be "hidden but still accessible", however, this does not appear to be the case - it renders as visible within the browser.
Is there a way to disable jQuery from creating this element within my form?
Hide the class on focus:
$( ".selector" ).autocomplete({
focus: function (event, ui) {
$(".ui-helper-hidden-accessible").hide();
event.preventDefault();
}
});
这篇关于jQuery手机:ui-helper-hidden-accessible的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!