Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Ionic 4-单击事件不在browserstack上工作,但在浏览器上工作_Angular_Ionic Framework_Browserstack - Fatal编程技术网

Angular Ionic 4-单击事件不在browserstack上工作,但在浏览器上工作

Angular Ionic 4-单击事件不在browserstack上工作,但在浏览器上工作,angular,ionic-framework,browserstack,Angular,Ionic Framework,Browserstack,我认为问题在于(点击),因为点击在浏览器中使用(工作),但在移动设备中是触摸而不是点击(不工作)。所以我试着用触控(ontouchend)代替(click),但没有任何效果 后来我觉得问题在于下面的代码片段 var event: HTMLElement = document.getElementById(id) as HTMLElement; event.click();` 这是我的密码 .html 我希望在单击ion文本字段时,应立即选中该单选按钮。因为只有在移动设备上进行测试时才会遇到此问

我认为问题在于(点击),因为点击在浏览器中使用(工作),但在移动设备中是触摸而不是点击(不工作)。所以我试着用触控(ontouchend)代替(click),但没有任何效果

后来我觉得问题在于下面的代码片段

var event: HTMLElement = document.getElementById(id) as HTMLElement;
event.click();`
这是我的密码

.html


我希望在单击ion文本字段时,应立即选中该单选按钮。

因为只有在移动设备上进行测试时才会遇到此问题,该问题可能与ion v4有关。您可以在此处查看关于相同行为的以下问题-

<ion-item>
    <ion-label class="amount-label pr1">Other</ion-label>
    <ion-radio id="other" class="mr2" mode="md" slot="start" value="other" (click)="toggleAmount('O')">
    </ion-radio>
    <div class="mt3 other-dollar">
        <ion-input currencyTypo class="other-amount-section" placeholder="0.00" (input)="validateAmount($event.target.value)" maxLength="7" type="number" pattern="^\d* (\.\d{0,2})?$" (click)="checkRadio('other')" formControlName = "otherAmount">
         <div class="dib pr1">$</div>
         </ion-input>
     </div>
</ion-item>
checkRadio(id: string) {
    var event: HTMLElement = document.getElementById(id) as HTMLElement;
    event.click();
}