mirror of
https://github.com/zulip/zulip.git
synced 2026-06-15 21:01:31 +08:00
This commit removes the deprecated `keypress` event. Now, we use the `keydown` event. Earlier, we used `keypress` because it allowed us to distinguish between lowercase and uppercase characters using `event.which`. For example: * For 'r': * keypress.which = 114 * keydown.which = 82 * For 'R': * keypress.which = 82 * keydown.which = 82 As shown, `keydown.which` cannot distinguish between 'r' and 'R', which is why `keypress` was helpful. Now, modern browsers support `event.key` on `keydown`, which directly gives 'r' or 'R' as needed. This makes `keypress` unnecessary, and we can safely rely on `keydown` with `event.key` to get the exact character. An earlier commit in this PR #34825, in which we replaced the `event.which` with `event.key` plays a major role as a prep commit to help removing `keypress` event in this commit. |
||
|---|---|---|
| .. | ||
| e2e-tests | ||
| generated | ||
| html | ||
| images | ||
| server | ||
| shared | ||
| src | ||
| styles | ||
| templates | ||
| tests | ||
| third | ||
| .browserslistrc | ||
| .gitignore | ||
| babel.config.js | ||
| debug-require-webpack-plugin.ts | ||
| debug-require.cjs | ||
| postcss.config.js | ||
| webpack.assets.json | ||
| webpack.config.ts | ||
| webpack.dev-assets.json | ||