Code Monkey home page Code Monkey logo

Comments (10)

laurisvan avatar laurisvan commented on September 7, 2024 1

We just got fresh insight from the problem and actually managed to fix the problem. When checking the problem, we had multiple nested overflowing items (causing multiple nested scrollbars). We anticipated the triple scrollbars were the cause of the problem, and fixed them. As a result, the problem no longer appears.

If you are interested, I can try to fish for more information. I believe it is still related to MUI, but not specifically to DataGrid.

from mui-x.

michelengelen avatar michelengelen commented on September 7, 2024

Hey @laurisvan ... thanks for raising this. It is indeed a bit strange to see that error.

From your description it is not an easy task to determine where to initially look for tbh.
I will loop in our team here to see if we can find a solution for you soon.

@MBilalShafi or @romgrk Could you maybe have a hint or encountered this before?

from mui-x.

romgrk avatar romgrk commented on September 7, 2024

No, we don't have enough information here. We'd need to at least be able to see the code to better assess what's causing it. It would also be nice to have the full stack traces, that could also tell us what's causing it.

from mui-x.

laurisvan avatar laurisvan commented on September 7, 2024

The innermost wrapper before DataGrid is as follows. The whole component structure is quite deep, so I am not sure how much more I can give without making the set of examples exhaustive:

import { GridColDef } from '@mui/x-data-grid-premium'

import { translate } from '$lib/locale'
import { formatDate } from '$lib/util/timeFormattingUtils'
import { DataGrid } from '$widgets/utils/DataGrid/DataGrid'
type RelationsListGridProps = {
  relationsList: { id: string; name: string; startsAt?: string; endsAt?: string | null }[]
  onCellClick: (relation: any) => void
}

export default function RelationsListGrid(props: RelationsListGridProps): React.ReactElement {
  const columns: GridColDef[] = [
    {
      field: 'name',
      headerName: translate('generic.name'),
      flex: 1,
      valueGetter: (params) => params.row.name
    },
    {
      field: 'parentName',
      headerName: translate('profile-details.dimension'),
      flex: 1,
      valueGetter: (params) => params.row.parentName
    },
    {
      field: 'startsAt',
      headerName: translate('generic.startsAt'),
      width: 150,
      valueGetter: (params) => formatDate(params.row.startsAt as string, { displayYear: true })
    },
    {
      field: 'endsAt',
      headerName: translate('generic.endsAt'),
      width: 150,
      valueGetter: (params) => formatDate(params.row.endsAt, { displayYear: true, renderAsExclusiveEndDate: true })
    },
    {
      field: 'selfEditable',
      headerName: translate('generic.selfEditable'),
      width: 150,
      valueGetter: (params) => (params.row.selfEditable ? translate('boolean.true') : '')
    }
  ]

  return (
    <DataGrid
      disableMultipleRowSelection
      checkboxSelection={false}
      onCellClick={props.onCellClick}
      columns={columns}
      rows={props.relationsList}
      initialState={undefined}
    />
  )
}

The whole widget tree is exhaustive, but I'll try to provide some bits from above and below the graph, just in case the structure gave any hints.

Screenshot 2023-12-21 at 20 07 57 Screenshot 2023-12-21 at 20 07 34

from mui-x.

romgrk avatar romgrk commented on September 7, 2024

I don't see anything unusual. Next step would be to get a full stack trace, including line numbers, so we can pinpoint where it's going wrong. The interesting data isn't just the last entry, it's the entries leading to the stack overflow.

from mui-x.

laurisvan avatar laurisvan commented on September 7, 2024

Unfortunately I am not able to extract full stack trace, as TrackJS only provides a few traces. As soon as I am able to repeat the problem myself, I could give full information.

I am not sure if it gives any more insight, but all the reported browsers are Windows 10 Chromes, with either version 120.0 or 119.0. One of the users confirmed this does not repeat on Edge browser on the same Windows machine.

Here's what I am able to give:

obj ../../../node_modules/@mui/x-data-grid/hooks/core/useGridApiInitialization.js 23:10
Showing original source content from sourcemap
 if (visibility === 'public') {
   publicApi[methodName] = methods[methodName];
 } else {
   privateOnlyApi[methodName] = methods[methodName];
 }
 });
 };
 const handler = {
     get: (obj, prop) => {
       if (prop in obj) {
         return obj[prop];
       }
       return privateOnlyApi[prop];
     },
     set: (obj, prop, value) => {
         obj[prop] = value;
{anonymous} ../../../node_modules/@mui/x-data-grid/hooks/core/useGridStateInitialization.js 28:68
Showing original source content from sourcemap
 return false;
 }
 let ignoreSetState = false;
 
 // Apply the control state constraints
 const updatedControlStateIds = [];
 Object.keys(controlStateMapRef.current).forEach(stateId => {
       const controlState = controlStateMapRef.current[stateId];
       const oldSubState = controlState.stateSelector(apiRef.current.state, apiRef.current.instanceId);
       const newSubState = controlState.stateSelector(newState, apiRef.current.instanceId);
       if (newSubState === oldSubState) {
         return;
       }
       updatedControlStateIds.push({
             stateId: controlState.stateId,
             hasPropChanged: newSubState !== controlState.propModel
{anonymous} ../../../node_modules/@mui/x-data-grid/hooks/core/useGridStateInitialization.js 26:44
Showing original source content from sourcemap
 }
 if (apiRef.current.state === newState) {
   return false;
 }
 let ignoreSetState = false;
 
 // Apply the control state constraints
 const updatedControlStateIds = [];
 Object.keys(controlStateMapRef.current).forEach(stateId => {
       const controlState = controlStateMapRef.current[stateId];
       const oldSubState = controlState.stateSelector(apiRef.current.state, apiRef.current.instanceId);
       const newSubState = controlState.stateSelector(newState, apiRef.current.instanceId);
       if (newSubState === oldSubState) {
         return;
       }
       updatedControlStateIds.push({
fn ../../../node_modules/@mui/x-data-grid/hooks/utils/useGridApiMethod.js 14:19
Showing original source content from sourcemap
 if (!privateApiRef.current) {
   return;
 }
 apiMethodsNames.forEach(methodName => {
   if (!privateApiRef.current.hasOwnProperty(methodName)) {
     privateApiRef.current.register(visibility, {
       [methodName]: (...args) => {
         const fn = apiMethodsRef.current[methodName];
         return fn(...args);
       }
     });
   }
 });
 }, [apiMethodsNames, privateApiRef, visibility]);
 React.useEffect(() => {
       apiMethodsRef.current = apiMethods;
{anonymous} ../../../node_modules/@mui/x-data-grid/hooks/features/columns/useGridColumns.js 48:19
Showing original source content from sourcemap
 stateId: 'visibleColumns',
   propModel: props.columnVisibilityModel,
   propOnChange: props.onColumnVisibilityModelChange,
   stateSelector: gridColumnVisibilityModelSelector,
   changeEvent: 'columnVisibilityModelChange'
 });
 const setGridColumnsState = React.useCallback(columnsState => {
   logger.debug('Updating columns state.');
   apiRef.current.setState(mergeColumnsState(columnsState));
   apiRef.current.forceUpdate();
   apiRef.current.publishEvent('columnsChange', columnsState.orderedFields);
 }, [logger, apiRef]);
 
 /**
  * API METHODS
  */
setGridColumnsState ../../../node_modules/@mui/x-data-grid/hooks/features/columns/useGridColumns.js 249:6
Showing original source content from sourcemap
 /**
  * EVENTS
  */
 const prevInnerWidth = React.useRef(null);
 const handleGridSizeChange = viewportInnerSize => {
   if (prevInnerWidth.current !== viewportInnerSize.width) {
     prevInnerWidth.current = viewportInnerSize.width;
     setGridColumnsState(hydrateColumnsWidth(gridColumnsStateSelector(apiRef.current.state), viewportInnerSize.width));
   }
 };
 useGridApiEventHandler(apiRef, 'viewportInnerSizeChange', handleGridSizeChange);
 
 /**
  * APPLIERS
  */
SNe.p ../../../node_modules/@mui/x-data-grid/hooks/utils/useGridApiEventHandler.js 33:92
Showing original source content from sourcemap
 const subscription = React.useRef(null);
 const handlerRef = React.useRef();
 handlerRef.current = handler;
 const cleanupTokenRef = React.useRef(null);
 if (!subscription.current && handlerRef.current) {
   const enhancedHandler = (params, event, details) => {
     if (!event.defaultMuiPrevented) {
       var _handlerRef$current;
       (_handlerRef$current = handlerRef.current) == null ? void 0 : _handlerRef$current.call(handlerRef, params, event, details);
     }
   };
   subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);
   cleanupTokensCounter += 1;
   cleanupTokenRef.current = {
     cleanupToken: cleanupTokensCounter
   };
SNe.emit ../../../node_modules/@mui/x-data-grid/utils/EventManager.js 57:17
Showing original source content from sourcemap
 const listener = highPriorityListeners[i];
 if (collection.highPriority.has(listener)) {
   listener.apply(this, args);
 }
 }
 for (let i = 0; i < regularListeners.length; i += 1) {
   const listener = regularListeners[i];
   if (collection.regular.has(listener)) {
     listener.apply(this, args);
   }
 }
 }
 once(eventName, listener) {
     // eslint-disable-next-line consistent-this
     const that = this;
     this.on(eventName, function oneTimeListener(...args) {
{anonymous} ../../../node_modules/@mui/x-data-grid/hooks/core/useGridApiInitialization.js 67:39
Showing original source content from sourcemap
 const [name, params, event = {}] = args;
 event.defaultMuiPrevented = false;
 if (isSyntheticEvent(event) && event.isPropagationStopped()) {
   return;
 }
 const details = props.signature === GridSignature.DataGridPro ? {
   api: privateApiRef.current.getPublicApi()
 } : {};
 privateApiRef.current.eventManager.emit(name, params, event, details);
 }, [privateApiRef, props.signature]);
 const subscribeEvent = React.useCallback((event, handler, options) => {
       privateApiRef.current.eventManager.on(event, handler, options);
       const api = privateApiRef.current;
       return () => {
         api.eventManager.removeListener(event, handler);
       };

from mui-x.

michelengelen avatar michelengelen commented on September 7, 2024

@mui/xgrid do we have someone with a similar setup (windows 10, chrome v119 or v120 and edge) to test this?

from mui-x.

romgrk avatar romgrk commented on September 7, 2024

I could boot in windows 11 to try it.

@laurisvan I just noticed that you're on an older version of the grid, could you try the latest 6.x version?

from mui-x.

github-actions avatar github-actions commented on September 7, 2024

The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion.

from mui-x.

romgrk avatar romgrk commented on September 7, 2024

If you find more detailed information you can post here or in the main MUI repository if applicable, but it's also fine to close it and wait until someone has a clear & reproducible case.

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.