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

Improve UX when invalid drawing happens #212

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

ddjnw1yu
Copy link
Contributor

@ddjnw1yu ddjnw1yu commented Nov 20, 2024

The following cases will cause some UX issues:

  • Pressing ESC will cancel a drawing, but the tool button will still be selected.
  • Drawing a point (clicking on the same position twice) when the line tool is selected. The drawing will be cancelled, but the tool button will still be selected.
  • Drawing a point/line when the polygon tool is selected. The drawing will be cancelled, but the tool button will still be selected.
  • Pressing Enter/Return when a drawing is not completed. The drawing will be cancelled, but the tool button will still be selected.

The reason is that we switched from using the built-in toolbar to using direct API calls. Some of the keyboard and mouse support no longer exist.

@ddjnw1yu ddjnw1yu marked this pull request as ready for review November 20, 2024 03:29
Copy link
Member

@alan-wu alan-wu left a comment

Choose a reason for hiding this comment

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

The implementation needs to be improved on this. the number of callbacks increases the more I change the draw tool. The remove event listener will not work because the callback (second argument) in the addEventLister itself is an anonymous function.

Copy link
Member

@alan-wu alan-wu left a comment

Choose a reason for hiding this comment

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

Thanks, much better and work well.

@alan-wu alan-wu merged commit e113106 into ABI-Software:main Nov 21, 2024
1 check passed
@ddjnw1yu ddjnw1yu deleted the improve-invalid-draw-handler branch November 25, 2024 22:48
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

Successfully merging this pull request may close these issues.

2 participants