Comments (5)
But it would be incorrect. E.g. in dvorak layout, the physical V key corresponds to the logical X symbol. So a dvorak user pressing Ctrl + X
(in their layout) might have the event.code
as KeyV
.
from mui-x.
@michelengelen we would like to pick this up
from mui-x.
@shaharyar-shamshi You can open a PR with the fix. I would avoid event.code
, according to the spec .code
represents a physical key, which might not match with the logical key for unusual keyboard layouts.
from mui-x.
@michelengelen I would like to pick up this issue.
after initial checking I found out when caps lock is on CTRL + v becomes CTRL + V
So this
code will not work as it checking for lowercase v only
corrected version of code will be
const isPasteShortcut = (event: React.KeyboardEvent) => {
return (
(event.ctrlKey || event.metaKey) &&
(event.key.toLowerCase() === 'v' || event.code.toLowerCase() === 'keyv')
);
};
If you can assign this to me
from mui-x.
@shaharyar-shamshi You can open a PR with the fix. I would avoid
event.code
, according to the spec.code
represents a physical key, which might not match with the logical key for unusual keyboard layouts.
Yes I agree but it is in or condition to be on safer side I included it.
from mui-x.
Related Issues (20)
- [charts] `ChartsTooltip` often not working properly when assigning `innerRadius` in series and using `ResponsiveChartContainer` HOT 2
- [data grid] Upgrading `@mui/x-data-grid-premium` to `v7` produces emotion error HOT 19
- [data grid] `checkboxSelection` Issue HOT 4
- [data grid] Print issue HOT 2
- [data grid] How to change the default DataGrid density to compact? HOT 3
- [data grid] customized sort tooltip flashes during server-side sort HOT 2
- [charts] Allow basic customization of Sparkline y-axis HOT 3
- Move @mui/internal-test-utils to devdepedencies. HOT 7
- [pickers] Toolbar components are not using the set `timezone` HOT 8
- [pickers] Wrong focusable component on Year Calendar HOT 1
- [charts] bar chart gradient color HOT 6
- Dayjs type removed from Datepicker value HOT 3
- [data grid] The user should not hide all columns; at least one column should be displayed HOT 4
- [data grid] How does pagination work when the row elements are not static? HOT 2
- [data grid] Strange behavior when `paginationMode` is `undefined` HOT 1
- [pickers] The date picker shouldn't steal the focus when closing HOT 4
- [data grid] Flex col definition breaks on print. HOT 9
- Adding properties to CustomTreeItem for RichTreeView HOT 7
- [data grid] Filter layout issue in datagrid HOT 10
- [docs] Create a new page to introduce the concept of `slots` and `slotProps`
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 mui-x.