React - 当用户错过要填充页面的一个特定元素时,我想模糊或变暗除特定元素之外的所有页面
基本上,我希望用户关注他们犯错或跳转该元素的元素。我的主要目标是通过更好的 UI 吸引用户的注意力
我尝试使用 getBoundingClientRect()
获取该元素的位置, 然后尝试使用 "react-native-blur"
这是正确的方法还是怎么做?
Basically i want the user to focus on that element where they make mistake or jump that element. My main goal is attract user's attention with better UI
I try to get position of that element with getBoundingClientRect()
,
then try to use "react-native-blur"
Is it right way to do this or how to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要监视更改并根据特定事件验证字段。最简单的方法是使用 react-hook-form 等库。它自动关注第一个字段,并出现错误
示例
You need to monitor changes and validate field upon certain event. It's easiest to use library such as react-hook-form. It automatically focuses on first field with error
Example