gpt4 book ai didi

ios - Ionic TextFile 清除按钮键盘行为 iOS

转载 作者:行者123 更新时间:2023-11-29 01:03:51 25 4
gpt4 key购买 nike

我的 Ionic 应用程序中有一个文本输入,在同一范围内有 2 个按钮。第一个按钮用于进行搜索,第二个按钮用于清除文本输入。当我点击清除按钮时,我看到了奇怪的行为,文本输入被清除并且键盘重新出现但文本字段没有焦点。

任何人都可以帮助我确保文本输入在清除文本后仍然具有焦点吗?谢谢。

<form class="list">
<span class="item item-input-inset">
<label class="item-input-wrapper address-label" name="addressLabel">
<i class="icon ion-ios-search placeholder-icon" ng-show="!address.length"></i>
<input type="text" class="address-input" placeholder="Search By Address" ng-model="address" autocomplete="off" autocorrect="off" autocapitalize="off">
</label>
<button type="submit" id="button1" class="button button-small custom-btn ion-search" ng-click="search(address)" ng-show="address.length"></button>
<button ng-click="address = ''" class="button button-small custom-btn ion-close-round" ng-show="address.length"></button>
</span>
</form>

最佳答案

看看 ionic 框架论坛上的这篇帖子。看起来这会奏效,并为您提供更原生的外观和感觉。

<div class="list list-inset">
<div class="item item-input">
<input type="text" placeholder="mail stop"
name="mail_stop_name"
>
<i class="icon ion-ios-close placeholder-icon"
data-tap-disabled="true" on-touch="formData.mail_stop_name = ''"></i>
</div>
</div>

引用: https://forum.ionicframework.com/t/clear-button-inside-input-causes-input-to-loose-focus/17016

关于ios - Ionic TextFile 清除按钮键盘行为 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36663485/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com