Closed vadimshvetsov closed 3 years ago
Is this fix now part of any public release? I am also seeing it and just want to see if upgrading to any new version will fix it? Thanks.
@apatole at this moment this is not a part of any public release. We are waiting for @dylanvorster capacity for checking this out.
@vadimshvetsov Thank you for the updates.
Checklist
yarn run pretty
What?
We've got an error
Uncaught TypeError: Cannot read property 'reportedPosition' of null at DefaultLinkModel.setSourcePort
when we uselink.clearPort(port)
Why?
Because we call then
link.setSourcePort(null)
orlink.setTargetPort(null)
to remove port from link. https://github.com/projectstorm/react-diagrams/blob/d2f05438b8620147d7aa835f2799a0f56397d4e3/packages/react-diagrams-core/src/entities/link/LinkModel.ts#L156 https://github.com/projectstorm/react-diagrams/blob/d2f05438b8620147d7aa835f2799a0f56397d4e3/packages/react-diagrams-core/src/entities/link/LinkModel.ts#L158 But this methods doesn't check port existence before usingreportPosition
property. https://github.com/projectstorm/react-diagrams/blob/d2f05438b8620147d7aa835f2799a0f56397d4e3/packages/react-diagrams-core/src/entities/link/LinkModel.ts#L227 https://github.com/projectstorm/react-diagrams/blob/d2f05438b8620147d7aa835f2799a0f56397d4e3/packages/react-diagrams-core/src/entities/link/LinkModel.ts#L249How?
At first we need to expect null as input there for type safety. Then we would check port existence before using it's property
Feel good image: