Comments (3)
Hey @mogrady88,
I tried replicating your described behaviour, but wasn't able to do so. It seems there is something more going on in your component that I am not aware of.
Could you please provide a minimal reproduction test case with the latest version. This would help a lot 👷.
A live example would be perfect. You can find a examples and guides on how to find templates in our docs with which you can provide examples for your specific use-case: Support - Bug reproduction.
Thank you! 🙇🏼
from mui-x.
Hey Michel, you are right. The issue turned out to be my own. We're trying to implement a custom checkAll header with some additional functionality and it looks like there are some limitations around keyboard events. This source code reads like you short circuit keyboard events from custom renderHeader
components unless its of type __check__
.
Our current solution is to define a column with a field: 'custom'
and then subscribe to columnHeaderKeyDown
and manually handle the ArrowRight
, ArrowLeft
, and ArrowDown
eventing. I havent seen any clean example of a DataGrid with checkboxSelection
that includes a custom renderHeader
Do you have any advice on how to drill keyboard events to a ColDef
with a field of __check__
and a renderHeader
component? The simplest reproduction would be to add a renderHeader: () => <Button onClick={() => console.log('clicked'}>Click Me</Button>
. If I navigate via keyboard to that header and try to activate the button with Space
or Enter
no event comes through and that onClick doesnt fire.
from mui-x.
Well ... for the keyboard navigation to work you would need to handle key strokes inside the rendered header on your own. I did test it with a simple button and pressing space
or enter
did fire the onClick
event just fine (screencast below).\
Screen.Recording.2024-04-03.at.12.11.57.mov
The underlying problem why the keyboard navigation is no longer working is that the button receives focus and traps it. The events for arrows need to be bubbled to the parent container, so that they can act upon it.
from mui-x.
Related Issues (20)
- [data grid] how to select all visible rows on a page HOT 4
- [data grid] Selection and filtering do not work together HOT 1
- [docs] Demo ColDefChangesGridNoSnap crashes HOT 1
- [pickers][DatePicker] Toggle date selection when same date is clicked HOT 2
- [charts] Improve `sx` documentation
- [data grid] Export to Excel and CSV only displayed Data (filtered and sorted) HOT 1
- [DateTimeRangePicker] Different selection flow option HOT 2
- [data grid] Clipboard copy places unnecessary quotations when copied text contains a quotation HOT 4
- DesktopDatePickerProps<Date> error Type 'Date' does not satisfy the constraint 'never' in version 7.1.0 HOT 10
- [data grid] Export to Excel causes rows to be misaligned from their headers (with checkboxes present) HOT 3
- [data grid] rendering complex components in a cell push pieces to following rows HOT 3
- [data grid] Support the custom header filter height that is independent from the column header height HOT 8
- [fields] Can not type into date picker after dismissing calendar picker HOT 3
- [TreeView] Improve keyboard navigation based on the ARIA spec
- The GridValueFormatterParams interface has NOT been removed in v7 HOT 1
- [DataGrid] Server-side filter demo not working HOT 1
- [DatePicker] DatePicker dayjs date format not working v7.0.0 HOT 1
- [data grid] Module '"@mui/x-data-grid-premium"' has no exported member 'GridColDef'. HOT 3
- [pickers] Allow to customize the size / density of the views HOT 5
- [fields][DateField] fails to accept '22' as day keybord input in FR locale with format Do MMM YYYY HOT 2
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.