BB10-能够在文本框中集中注意力,但不能打字

BB10 - Able to focus in text box but not able to type

本文关键字:注意力 但不能 集中 文本 BB10-      更新时间:2023-09-26

我有一个BB10应用程序,它会检查空值字段,然后提醒用户注意空字段,一旦用户单击"确定",焦点就会放在文本框中。我可以在文本框中放置焦点,但我不能在其中键入任何内容。

文本字段和按钮

 strDetailClaim += '<div class="detailsRow">';
 strDetailClaim += '<div class="detailsLabel">GL CODE</div><div 
 class="detailsValue"><input type="text" id="glCode_'+i+'"  
 name="glCode_'+referenceNo+'" size="9" value="'+detailsGLCode+'"></div>';
 strDetailClaim += '<span class="spanApprove"><button id="approveButton"   
 class="formButton" type="button" ontouchstart="shadowHighlight(this)" 
 ontouchend="noShadowHighlight(this); setTimeout(function()
 {approveClaim('''+referenceNo+''')},300)">APPROVE</div>';

批准的一部分索赔功能

 alert("GL Code for claim number " + indieClaim[referenceNo].details[i].runno + " must  
 not be empty. Please key-in GL Code");
 setTimeout(function(){document.getElementById('glCode_'+i+'').focus()},200);
 return false;

奇怪的是,如果我删除提醒功能,我可以在文本框中获得焦点,并能够在其中键入一些内容

我是不是遗漏了什么?是否存在允许警报然后允许用户在文本框中键入的情况?

设置焦点后是否尝试调用警报?

还要尝试将document.activeElement设置为document.getElementById('glCode_'+i)?

我不确定你是否是这样,但我也遇到了同样的问题。

我的问题是,出于某种疯狂的原因,我在CSS 中有这个

-webkit-user-select: none;

它允许我点击文本输入,但不允许我键入。