Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix item with subitems crash when clicked #83

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

Claybarn
Copy link
Contributor

Add dummy handler to item with subitems to prevent crashing. Fixes #81.

@Claybarn
Copy link
Contributor Author

This solved the crashing issue but introduced a new one. It prevented zooming in and out on the graph. Will see if there is another solution.

@Claybarn
Copy link
Contributor Author

Actually I take that back, the zooming issue happens if I compile the module from scratch without any changes at all.

@@ -28,6 +28,7 @@ export function createItem<S extends BSchemes>(
}
return <Item>{
...item,
subitems: factory.map((data, i) => createItem(data, i, context))
subitems: factory.map((data, i) => createItem(data, i, context)),
handler: Function()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unsafe due to Content Security Policy directive: "script-src"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, can you squash commits into a single one with name of the format "fix: "? (unfortunately this part is not covered in the Contribution guide)

@Ni55aN
Copy link
Member

Ni55aN commented Feb 29, 2024

the zooming issue happens if I compile the module from scratch

https://github.com/retejs/react-plugin/blob/main/src/presets/context-menu/components/Menu.tsx#L39

this is expected behavior. Do you think it should passthrough context menu?

@Claybarn Claybarn force-pushed the main branch 2 times, most recently from 9a571d9 to 2b4e774 Compare March 3, 2024 22:16
@Claybarn
Copy link
Contributor Author

Claybarn commented Mar 3, 2024

I collapsed the commits, let me know if anything else needs changing.

@Ni55aN
Copy link
Member

Ni55aN commented Mar 6, 2024

please check CI and Commit linter workflows

Create empty handler function to avert crash when item with subitems is clicked clicked

Update factory.ts

Update factory.ts

Update factory.ts

fixed trailing comma
Copy link

sonarqubecloud bot commented Mar 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@Ni55aN
Copy link
Member

Ni55aN commented Mar 7, 2024

commit message isn't conventional

@Ni55aN
Copy link
Member

Ni55aN commented Mar 7, 2024

anyway, I can merge it into different branch and rebase

@Ni55aN Ni55aN changed the base branch from main to fix-subitems-exception March 7, 2024 19:46
@Ni55aN Ni55aN changed the base branch from fix-subitems-exception to main March 7, 2024 19:49
@Ni55aN Ni55aN merged commit a9c3f22 into retejs:main Mar 7, 2024
4 of 5 checks passed
@rete-js
Copy link
Contributor

rete-js bot commented Mar 7, 2024

🎉 This PR is included in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rete-js rete-js bot added the released label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking on item with subitems causes type error
2 participants