-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Modal.prompt input hit area too small & keyboardavoidView #1489
Comments
之前听说过 Mobile safari focus 问题,实现不了 autofocus。 在只有一个 input 的情况下,能不能让整个 body 都做为 hit area? |
这个我不赞成,点击区域扩得太大了。 这个尝试提供 focus. #1243 |
扩大到 body,太大了 |
别激动,随口一说。😁 我自己的解决办法是增加 |
实测居中是比较难点,要么样式上优化,要么提供 js 的 focus api |
@silentcloud Modal.Prompt 的 sketch 在哪?发我一份,input 感觉高度太小了 |
@paranoidjk 这个有点时间了,我本地是没有了,找设计师问问看还有没有 |
<label>
<h2>标题</h2>
<input />
</label> 套个 label。 |
@afc163 甚至都没办法指定 input text/password 以外的类型。 是不是应该再加一个 custom type,允许用户传入自己的 input,甚至允许任意 Element,只要接口符合就行。 interface {
defaultValue: any
// focus: () => void // 这个可以不要,调用的时候判断有没有 focus 方法。
onChange: (value: string) => void
} |
那这个 api 方法就不好定了,而且还要 rn web 一致 |
键盘遮挡按钮问题不知道大家如何解决呢? |
应该不会有键盘遮挡的问题,antd-mobile 做了 处理,实测也无法复现。 请提供可复现的 demo. |
在react native平台 |
@silentcloud 实测的确有键盘遮挡的问题,rn 有办法类似 web scrollIntoView 的方案吗? |
嗯,是可以采用这个方法,此方法需要考虑兼容andorid平台 |
是否考虑在此组件加入这个方法呢? |
@linhanyang 抱歉,最近比较忙,这个问题如上所说,你业务代码可以自己解决,优先级比较低。 组件内部实现的不完美的话,欢迎 PR 来帮我们修复。 |
嗯,我目前仅仅做了下调整,而且不是太好的办法。现在在ios上显示是个问题,不仅仅是业务问题。 |
同样的问题,项一下 |
我在rc-dialog下提了个pr react-component/dialog#67 , 参考react-native中语网的写法 , 将keyboardavoidingview放在 Modal下可以解决这个问题 |
@paranoidjk 好像这个问题还是没解决吧? |
Version
1.4.0
Environment
iPhone5s Safari
Reproduction link
https://mobile.ant.design/components/modal-cn/
Steps to reproduce
点击 prompt 里的 input
What is expected?
一次命中
What is actually happening?
要很仔细的找准位置。
The text was updated successfully, but these errors were encountered: