Search code examples
microsoft-graph-toolkit

Graph Toolkit - Clicking on folder opens a new window in mgt-file-list


I am using mgt-file-list component and clicking on folder opens a new window.I want to stop it. I checked the code and there is a property which I need to target - disable-open-on-click which is set to false in code, see link below. That’s also not available for external to use/change. Can anyone know how to stop folder opening in new window. Only files should open in new window. We don’t want folder to open in new window.

https://github.com/microsoftgraph/microsoft-graph-toolkit/blob/10b25f97ff9666bb9e0c0fadf5b453ced9da84fc/packages/mgt-components/src/components/mgt-file-list/mgt-file-list.ts#L407


Solution

  • There's is now an attribute, disable-open-on-click to suppress this behavior, once you have suppressed the default open on click, you can add your own custom behavior when items in the file list are clicked on, take a look at this story to guide you on that implementation: https://mgt.dev/?path=/story/components-mgt-file-list--events