gpt4 book ai didi

reactjs - react 选择不在移动设备上显示键盘并阻止缩放

转载 作者:行者123 更新时间:2023-12-03 13:57:02 25 4
gpt4 key购买 nike

我正在使用 React-Select 版本 2.4.2。在 iOS Chrome、Firefox、Safari 上进行测试。

我已经浏览了documentation但找不到正确的 Prop 来传递这种情况。

我希望菜单显示在移动设备上,而不是键盘或任何 iOS native 页脚。当然,切换 isDisabled 不起作用,因为它会禁用整个输入和选择菜单。

将“可搜索”属性翻转为 false 实际上会禁用键盘,但会在 Safari 和 Firefox 上显示带有“完成”的页脚,在 Chrome 上显示带有“X”的页脚。

理想情况下,我可以禁用输入,但仍然允许触摸选择选项。

示例代码:

    <Select
value={selectedOption}
options={selectOptions}
onChange={handleOptionSelect}
placeholder={placeholderText}
isDisabled={false} {/* bool toggles affect entire plugin */}
blurInputOnSelect={true} {/* don't want any input/keyboard on mobile */}
readonly={true} {/* tried, didn't work */}
searchable={false} {/* disables keyboard, but still shows iOS footer with "Done" button in Safari and Firefox, and an "X" in Chrome, and zooms in when touching select element */}
/>

最佳答案

尝试inputProps={{readOnly:true}}isSearchable={ false }readonly不作为 <Select /> 上的直接 Prop 公开组件。

关于reactjs - react 选择不在移动设备上显示键盘并阻止缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55229134/

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