Comments (6)
Hey @marcpachecog and thanks for raising this.
It's actually a good question why we did not implement a complimentary event listener for mouseOver
.
I will add this to the board.
On another note: Why did we go for mouseOver
and not mouseEnter
? mouseOver
will "drill down" the handler to all children and this could potentially impact performance in complicated cell renderers. This W3Schools example schowcases it really well
WDYT @mui/xgrid ?
from mui-x.
This relates to this page
TLDR: We removed those events from apiRef.subscribeEvent
so that only people that need them pay the performance price of setting the event on the HTML element.
So adding them back is probably not a good solution.
But maybe we can improve the doc or the behaviors on how people can pass other event listeners to a cell / a row.
from mui-x.
Feels inconsistent that we publish cellMouseOver
but not cellMouseLeave
.
so that only people that need them pay the performance price of setting the event on the HTML element.
@flaviendelangle I'm curious about the performance justification, isn't react supposed to use event bubbling and only attach event listeners to the root of the tree? Something like this: https://blog.logrocket.com/event-bubbling-capturing-react/
Either way it's good that we remove unused props though.
@marcpachecog Wdym by "prevent rerenders"? You shouldn't be passing inline objects directly, maybe this section of the docs would help: https://mui.com/x/react-data-grid/performance/#extract-static-objects-and-memoize-root-props
from mui-x.
Feels inconsistent that we publish cellMouseOver but not cellMouseLeave.
I think we just kept the one we were using internally
@flaviendelangle I'm curious about the performance justification, isn't react supposed to use event bubbling and only attach event listeners to the root of the tree? Something like this: https://blog.logrocket.com/event-bubbling-capturing-react/
It was the justification when the change was done, but I never explored the topic tbh.
If we publish an event even if there is no-one listening to it, so for event very frequently published (like cellMouseLeave
/ cellMouseLeave
) we have at least the cost of running publishEvent
, but this seems pretty low (and cellMouseOver
is called a lot more).
Could be worth exploring the performance cost if we want to add some of those events back, but the slotProps
approach should work fine as well.
from mui-x.
The issue has been inactive for 7 days and has been automatically closed.
from mui-x.
I added the waiting-for-author tag because there was a question for @marcpachecog in my last comment, and the other comments pointed out good alternatives. Feel free to reopen.
from mui-x.
Related Issues (20)
- [data grid] Format row count numbers in pagination HOT 13
- [pickers] AdapterDateFnsV3: Wrong types generated HOT 1
- [data grid] useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component HOT 3
- [data grid] infinite loop occurs under certain circumstances HOT 10
- New component Barcode & QRCode & scanner HOT 1
- [pickers][DateTimePicker] page scrolls when mouse is moved outside of it when using hour/minute picker HOT 3
- [pickers] DateBuilderReturnType provides wrong type with no arg HOT 3
- [data grid] Add support for async valueOptions callback HOT 1
- [docs] Tree View: check children, uncheck parents HOT 3
- [data grid] Column resizing doesn't work from group HOT 1
- [pickers][Datepicker][AdapterDateFnsV3] unable to set single digit day of month format HOT 4
- [charts] LineChart doesn't draw graph on page load HOT 1
- [charts][LineChart] unwanted horizontal line when rendering 100 data points HOT 4
- [data grid] Improve localization dx for custom filters
- [tree view][RichTreeView] Custom styling not working HOT 8
- [data grid] Support edit functionality with server-side data source
- GridHeaderCheckbox.js failed to compile x-data-grid after upgrading to v7
- [DataGrid] Add height property, analog to Chart
- [question] Upgrade to V6 => V7 breaks existing styles applied
- [data grid] Replace ExcelJS
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.