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 shouldAutoFocus prop to Overlay, SideSheet, and Dialog components #1535

Merged
merged 6 commits into from
Oct 25, 2022
Merged

Add shouldAutoFocus prop to Overlay, SideSheet, and Dialog components #1535

merged 6 commits into from
Oct 25, 2022

Conversation

brandongregoryscott
Copy link
Contributor

@brandongregoryscott brandongregoryscott commented Oct 18, 2022

Resolves #1404

Overview

This PR introduces a prop to Overlay, SideSheet and Dialog that allows a consumer to disable the default autofocus behavior that lives in Overlay.js. As noted in that task, there are certain cases where the behavior can be incorrect or undesirable but there's no obvious way to opt out of it. This PR addresses that - retaining the current behavior, but opening up a way to disable it if needed.

Screenshots (if applicable)

Behavior can be demoed in the respective Storybook areas:

https://deploy-preview-1535--evergreen-storybook.netlify.app/?path=/story/overlay--autofocus-disabled

https://deploy-preview-1535--evergreen-storybook.netlify.app/?path=/story/side-sheet--autofocus-disabled

(Scroll to bottom and click button 'Show Dialog with autofocus disabled')
https://deploy-preview-1535--evergreen-storybook.netlify.app/?path=/story/dialog--dialog

Documentation

  • Updated Typescript types and/or component PropTypes
  • Added / modified component docs
  • Added / modified Storybook stories

@brandongregoryscott brandongregoryscott added the hacktoberfest-accepted Approved PR participating in Hacktoberfest label Oct 18, 2022
@netlify
Copy link

netlify bot commented Oct 18, 2022

Deploy Preview for evergreen-storybook ready!

Name Link
🔨 Latest commit ad68171
🔍 Latest deploy log https://app.netlify.com/sites/evergreen-storybook/deploys/6358219c67c38200085bf457
😎 Deploy Preview https://deploy-preview-1535--evergreen-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@neztEx neztEx left a comment

Choose a reason for hiding this comment

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

Looks good!

@brandongregoryscott brandongregoryscott merged commit 37ec8bb into segmentio:master Oct 25, 2022
@brandongregoryscott brandongregoryscott deleted the disable-overlay-autofocus branch October 25, 2022 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Approved PR participating in Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to disable autofocus logic in Overlay component
2 participants