-
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
VirtualInput 的 keyboard参数的getContainer失效 #6318
Labels
Comments
应该是预期行为? |
为什么会如此做? 我觉得这个还是开放可控更好,因为这种浮窗在子组件内可能会产生很多不必要的麻烦。 |
刻意加的代码总有它的道理~ 看commit msg意思是 防止长按使输入元素丢失... |
然而那个问题并没有完全解决 |
曲线解决了此问题 const NumberKeyboardWithContainer = (
props: Omit<NumberKeyboardProps, 'getContainer'> & {
container: NumberKeyboardProps['getContainer'];
},
) => {
return <NumberKeyboard {...props} getContainer={props.container} />;
};
<VirtualInput
keyboard={
<NumberKeyboardWithContainer
data-key={uniqueKey}
className={classnames('numberkeyboard', keyboardClassName)}
container={getContainer}
{...restKeyboardProps}
/>
}
/> |
思路挺好~ 那个问题没解决能说说吗 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of antd-mobile
v5.32.0
Operating system and its version
No response
Browser and its version
All
Sandbox to reproduce
No response
What happened?
该代码设置后keyboard还是渲染在了子元素内,未append到body。 这样键盘可能会继承input的一些自定义样式。
https://mobile.ant.design/zh/components/number-keyboard
https://mobile.ant.design/zh/components/virtual-input
Relevant log output
No response
The text was updated successfully, but these errors were encountered: