Skip to content
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

[SearchBar] 点击 取消的时候 输入框的值被清空 #6433

Closed
x011223 opened this issue Nov 14, 2023 · 1 comment
Closed

[SearchBar] 点击 取消的时候 输入框的值被清空 #6433

x011223 opened this issue Nov 14, 2023 · 1 comment
Labels

Comments

@x011223
Copy link

x011223 commented Nov 14, 2023

Version of antd-mobile

5.33.0

Operating system and its version

iOS

Browser and its version

ios chrome 110.0

Sandbox to reproduce

https://codesandbox.io/s/nostalgic-haze-n47jch?file=/src/App.tsx

What happened?

点击 取消 的时候输入框的值被清空了,我认为取消的作用应该只是将取消按钮隐藏,SearchBar样式 恢复,清空值的操作应由清除图标完成,否则功能是有交叉的。

另外,预期的是 防止用户误操作点到了输入框,然后点击取消,这时候 取消操作 并保留原来的值,从这个场景看 不清空值是比较合理的,否则 输入框的值被清空之后,那么我们的数据就 需要重新进行搜索并更新页面。

image

Relevant log output

No response

@x011223 x011223 added the bug label Nov 14, 2023
@zombieJ
Copy link
Member

zombieJ commented Nov 14, 2023

预设行为都可以通过受控改掉了:

https://codesandbox.io/s/broken-haze-l8zvch?file=/src/App.tsx

@zombieJ zombieJ closed this as completed Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants