-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi,
We've hit a strange issue, we have a custom keymap shortcut for indenting & outdenting tasks in Gantt in Salesforce that uses the standard indent handler. This works fine ordinarily, but with LWS & CDN turned off it fails and throws the error "TypeError: Cannot read properties of undefined (reading 'isProjectModel')" on this line in the indent function in TaskStore: nodes = nodes.filter(node => !(node.isProjectModel || node.readOnly));
I notice that function seems to be expecting tasks to be passed to it, but the keymap example shows this as a valid use case.
I can't reproduce it on your demo org myself as you need admin access to change the session settings, but these steps should work:
Add the following to your Gantt keymap:
'Alt+Shift+ArrowRight': null,
'Alt+Shift+ArrowLeft': null,
'Ctrl+i': [
{ handler: 'indent', weight: 200 }
],
'Ctrl+u': [
{ handler: 'outdent', weight: 200 }
]
Open Setup on an org
Go to Session Settings
Uncheck "Use Lightning Web Security for Lightning web components and Aura components"
Uncheck "Enable Content Delivery Network (CDN) for Lightning Component framework"
Go to your Gantt component, select a task and try to use the ctrl + i shortcut
Nothing happens
In our code, we have two additional handlers in each of those keymaps, but the same issue happens with or without them, so I don't think they should affect the result. We've also found that re-enabling LWS prevents this issue happening again, even if LWS is then turned back off - after that, the only way to encounter the error again is by re-enabling, then disabling CDN.
I appreciate this is a pretty specific issue, let me know if there's anything else I can do to make it easier to reproduce it. Thanks!