当前位置:网站首页>The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
2022-04-23 19:40:00 【Mediocre °】
problem
Let's talk about the demand scenario where the problem occurs , You need to click to display a drop-down box , Different drop-down boxes correspond to different Modal
Components , Including displaying account information , Ban / Enable the account number and fill in the reason and other requirements . Is to use the Dropdown
Components +Modal
+Input.Textarea
Components to do , After finishing, I found a little bug
. Click the up, down, left and right buttons in the text field , The cursor does not move with .
terms of settlement
After investigation , Find out Dropdown
If you click to select MenuItem
after , Do not retract it , Will find , After entering text in the text field , If you click the up and down buttons , The cursor does not move , however MenuItem
The selection will move with the keyboard event . This explanation MenuItem
perhaps Menu
There is also monitoring for keyboard events . It should be something done here that causes the movement of the text field cursor to fail , So what's the solution , Finally found in the text field or MenuItem
binding onKeyDown
Event in which to prevent event bubbling e.stopPropagation();
, There will be no impact .
Then I tried , The problem is not dropdown
Caused by the , It is Menu
, Even if we use it alone Menu
Component to implement and Modal
+ Similar problems occur in text fields . Stop the event from bubbling to solve .
Cause analysis of the problem
I guess the reason for this problem is , Keyboard event after modifying the cursor in the text field , Bubble to Menu
in , Click the up, down, left and right keys , Mobile MenuItem
The selection effect of , The focus moves from the text field to MenuItem
in , Will appear , The problem that the up, down, left and right keys can't control the cursor .
版权声明
本文为[Mediocre °]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231929196084.html
边栏推荐
- NiO related Basics
- 图书管理数据库系统设计
- Kubernetes entry to mastery - bare metal loadbalance 80 443 port exposure precautions
- OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
- Pit encountered using camera x_ When onpause, the camera is not released, resulting in a black screen when it comes back
- 优先使用组合而不使用继承
- Steps to build a deep learning environment GPU
- Kibana reports an error server is not ready yet. Possible causes
- Codeforces Round #783 (Div. 2) D题解
- Shanda Wangan shooting range experimental platform project - personal record (V)
猜你喜欢
Distinction between pointer array and array pointer
深度学习——特征工程小总结
Shanda Wangan shooting range experimental platform project - personal record (IV)
山大网安靶场实验平台项目—个人记录(四)
【webrtc】Add x264 encoder for CEF/Chromium
MySQL syntax collation (4)
MySQL syntax collation (3)
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Scrum Patterns之理解各种团队模式
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
随机推荐
Machine learning catalog
Build intelligent garbage classification applet based on Zero
Easy mock local deployment (you need to experience three times in a crowded time. Li Zao will do the same as me. Love is like a festival mock)
Lpc1768 optimization comparison of delay time and different levels
Shanda Wangan shooting range experimental platform project - personal record (IV)
精简CUDA教程——CUDA Driver API
点云数据集常用处理
Hot reload debugging
Kubernetes getting started to proficient - install openelb on kubernetes
MySQL syntax collation (4)
考试系统进入试卷优化思路
Pit encountered using camera x_ When onpause, the camera is not released, resulting in a black screen when it comes back
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Audio signal processing and coding - 2.5.3 the discrete cosine transform
MFCC: Mel频率倒谱系数计算感知频率和实际频率转换
The flyer realizes page Jump through routing routes
DevOps集成-Jenkins 服务的环境变量和构建工具 Tools
Pdf reference learning notes
MySQL syntax collation (5) -- functions, stored procedures and triggers
Speculation on the way to realize the smooth drag preview of video editing software