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

add toggleAdditionalOptions action #209

Merged

Conversation

murat-encord
Copy link
Contributor

Changes proposed in this pull request:

  • Adds an optional boolean prop closeAdditionalControlsOnClickBody to disable the default behaviour of closing the additionalControls when clicking anywhere on the body.

  • Introduces a new window context action toggleAdditionalControlsOpen to toggle additional controls. setAdditionalControlsOpen action required to explicitly pass a boolean and was hard to use as a toggle because the open/close boolean state is internal to the window and not exposed

Comment on lines 82 to 85
/**
* Sets the open state for the tray that holds additional controls
*/
toggleAdditionalControlsOpen: () => void;

Choose a reason for hiding this comment

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

the "open" at the end might imply that we want to open the tray, maybe just "toggle" is fine?

Suggested change
/**
* Sets the open state for the tray that holds additional controls
*/
toggleAdditionalControlsOpen: () => void;
/**
* Opens/closes the tray that holds additional controls
*/
toggleAdditionalControls: () => void;

@nomcopter
Copy link
Owner

Thanks for the PR! Made some tweaks - let me know how they work for you:

  1. Instead of disabling closing the toolbar on window-body-click, instead makes it disable the entire overlay, so users can still interact with the body. Should be better UX.
  2. Instead of adding a new method toggleAdditionalControlsOpen, added a possible 'toggle' option to the existing one that has the same effect.

@nomcopter nomcopter merged commit f3acc78 into nomcopter:master Sep 18, 2023
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.

3 participants