当前位置:网站首页>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
边栏推荐
- Executor、ExecutorService、Executors、ThreadPoolExecutor、Future、Runnable、Callable
- Command - sudo
- 【h264】libvlc 老版本的 hevc h264 解析,帧率设定
- Encyclopedia of professional terms and abbreviations in communication engineering
- Decompile and get the source code of any wechat applet - just read this (latest)
- MySQL syntax collation (4)
- 山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
- 2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
- Pdf reference learning notes
- The platinum library cannot search the debug process records of some projection devices
猜你喜欢
深度学习——特征工程小总结
Common SQL commands
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
Virtual machine performance monitoring and fault handling tools
Use of fluent custom fonts and pictures
Prefer composition to inheritance
如何在BNB链上创建BEP-20通证
Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
Class loading process of JVM
Deep learning -- Summary of Feature Engineering
随机推荐
Use of fluent custom fonts and pictures
Main differences between go and PHP
Unity创建超写实三维场景的一般步骤
Why is the hexadecimal printf output of C language sometimes with 0xff and sometimes not
SQL of contention for system time plus time in ocrale database
C语言的十六进制printf为何输出有时候输出带0xFF有时没有
MySQL syntax collation (3)
The usage of slice and the difference between slice and array
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
PostgreSQL
Deep learning -- Summary of Feature Engineering
antd dropdown + modal + textarea导致的textarea光标不可被键盘控制问题
Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项
Strange problems in FrameLayout view hierarchy
MySQL数据库 - 连接查询
Some ideas about time-consuming needs assessment
Codeworks round 783 (Div. 2) d problem solution
The most detailed network counting experiment in history (2) -- rip experiment of layer 3 switch
[H264] hevc H264 parsing and frame rate setting of the old version of libvlc
【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码