Comments (2)
Translation of this issue:
SELECT uses the query function. Under Electron, the first Chinese input method of TAB switch to the input is not displayed in the query.
REPRODUCTION LINK
[https://github.com/maximegris/angular-Electron] (https://github.com/maximegris/angular-Electron)
STEPS To Reproduce
SELECT uses the query function. Under Electron, the Tab switch to the first Chinese input method after the input is input.
The problem has been basically positioned. Check the source code. Select.comPonent.ts uses the keydown event to switch the hidden state of the pull DOM.
In the browser, the Chinese input method will trigger the KEYDOWN event, everything is normal.
In Electron, the Chinese input method will not trigger the Keydown event, and the drop -down DOM cannot be displayed. If the Keydown event is triggered in the future, it will be normal. It will only appear in the TAB switch to select (if the click has been activated), the Chinese input method will not trigger the keydown event, so that the query is not displayed.
test environment:
Download the code from https://github.com/maximegris/angular-Electron, and then use the DEV mode
NPM Run Electron: SERVE monitor port 4200, and start the source code of NG-Zorro-ATD locally to adjust the verification.
What is exfected?
Can increase the input method event monitoring or listening value changes to trigger, so that it can be compatible with the Electron environment
What is actually happy?
In the Electron environment, Chinese input method, TAB switch to select cannot show drop -down search
| ENVIRONMENT | Info |
| --- | --- | |
| NG-Zorro-ATD | 14.3.0 |
| Browser | Electron |
from ng-zorro-antd.
由于electron中的浏览器和web环境浏览器在中文输入法事件的差异化造成ng-zorron的select组件出现BUG:
具体场景:
比如当tab切换到select的时候,第一次中文输入法输入汉字 "发发发",会按键"fff"拼出"发发发".
web环境浏览器中,输入"fff"的同时会在input框中同时输入"fff",在中文输入法最后确认的时候会使用"发发发"替换"fff".
electron环境浏览器中,输入"fff"的同时不会在input框中输入任何字符,在中文输入法最后确认的时候会使用"发发发"直接放到输入框
翻看源码:select组件监听了keydown事件监听下拉查询框组件渲染,在electron中的中文输入法最后确认回车或者空格输入到input并不会触发keydown事件,从而不会在tab切换到select查询的第一使用中文输入法触发下拉查询框组件渲染,同时渲染下拉查询框组件渲染后就不会再重新渲染,所以只会出现在第一次中。
满足输入有值的条件,渲染下拉查询框组件目前2个修复方案:
修复方案1绑定中文输入法事件触发:考虑当前使用的keydown事件绑定到普通div上的,处理逻辑在当前select组件里,中文输入法的监听事件只能绑定到input等输入上。而包含输入组件的input最终在select组件下属嵌套层级孙级组件内,需要熟悉内部逻辑,处理组件通信,该方案跨组件修改代码。
修复方案2监听输入值变化触发:最终输入法确认到input后,input值的change事件会被触发,在select组件有孙级input值change事件的通知,可以在该处,同时判断是输入框没值的时候(第一次没值,尽可能减少影响范围),触发原有keydown事件的逻辑。
目前已采取修复方案2,快速修复,优先使用起来,建议使用修复方案1。
from ng-zorro-antd.
Related Issues (20)
- Time Range Picker component not provider for angular. But for react it is provided HOT 1
- 希望nz-tree暴露cdkVirtualScrollViewport的scrolledIndexChange事件 HOT 2
- arrow of edges disapper in nz-graph
- Borderless tag with status(eg: warning) HOT 1
- Optional floating input placeholders when input focused or not empty
- The nzOnChange event of the ColorPicker component will run twice
- select 支持全局配置 nzOptionHeightPx HOT 1
- Time picker in nz-date-picker does not respect nzFormat for time HOT 1
- 是否可以提供一个大数据UI风格的主题 HOT 1
- Docs issue: sometimes changing components not work HOT 1
- ng-zorro live website not working HOT 1
- <nz-list-item-action> not visible HOT 1
- nzLoading is not working with nz-card on v17.4.0 HOT 2
- nz-select with ngModel to initialize the selected value, the dropdown does not automatically scroll to the selected item if a scrollbar is present.
- Docs not working HOT 1
- What hapened with your site?
- Site doesn't work correctly HOT 5
- nzBackIcon in NzPageHeaderModule behaviour based on browser history
- nz-slider cannot jump to the exact value by clicking on the nzMarks labels
- confirm未对显示内容过滤防止xss攻击 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-zorro-antd.