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

Sanity check for Transform.select #5025

Open
mlajtos opened this issue Jun 10, 2022 · 0 comments · May be fixed by #5407
Open

Sanity check for Transform.select #5025

mlajtos opened this issue Jun 10, 2022 · 0 comments · May be fixed by #5407

Comments

@mlajtos
Copy link

mlajtos commented Jun 10, 2022

Problem
Transform.select(editor: Editor, target: Location) will use whatever target it is provided without checking it actually exists or if it points to leaf nodes.

Solution
Adding code that checks whether the target location exists and it is indeed leaf node. If it is not leaf node, it will use Editor.first(editor: Editor, at: Location).

Alternatives
Not adding code for checking. User might be surprised when s/he tries to select node at [0] and editor will crash or do something unexpected.

@zbeyens zbeyens linked a pull request Apr 27, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant