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

allow removal of missing Viewport controls #178

Open
axelpale opened this issue Apr 12, 2024 · 2 comments
Open

allow removal of missing Viewport controls #178

axelpale opened this issue Apr 12, 2024 · 2 comments

Comments

@axelpale
Copy link
Contributor

If the client tries to remove a Control that is not yet added to a viewport, currently that throws an error. Maybe such removal should be okay and silent. Think of the removal as an idempotent operation. Is addition already an idempotent operation if the component is already added to the same parent?

@axelpale
Copy link
Contributor Author

axelpale commented Apr 12, 2024

It does not help either that Viewport does not implement any "hasControl" method nor Component any "hasChild" method.

@axelpale
Copy link
Contributor Author

Current workaround is:

try {
  viewport.removeControl(alreadyRemovedControl)
} catch (e) {
  // noop
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant