-
Notifications
You must be signed in to change notification settings - Fork 117
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
feat(TearsheetShell): specify additional floating menu selectors #5092
base: main
Are you sure you want to change the base?
feat(TearsheetShell): specify additional floating menu selectors #5092
Conversation
DCO Assistant Lite bot All contributors have signed the DCO. |
✅ Deploy Preview for carbon-for-ibm-products ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I have read the DCO document and I hereby sign the DCO. |
@liunate Code looks fine to me. But could you please add a storybook for this to demonstrate the feature? |
…ecify-floating-menus-selectors
{`${beenOpen ? 'Reopen' : 'Open'} the ${context.component.displayName}`} | ||
</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these part could be rewritten in tidier way like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context.component.componentName
is no longer valid, so I replaced it to show the correct component name. In this case here, the TearsheetShell
); | ||
} | ||
|
||
export const FocusOnFloatingMenu = ({ open: _open, ...args }, context) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the recording showcasing the new property in action.
allow-floating-story.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine in story docs
as well
…ecify-floating-menus-selectors
Not sure why it failed at the |
Looks like something is timing out. I just triggered it to run again |
Hey @liunate, you just have one conflict to resolve in |
…ecify-floating-menus-selectors
@@ -179,6 +181,75 @@ NoAttributesSet.args = { | |||
}; | |||
|
|||
export const ReturnFocusToOpenButton = ReturnFocusTemplate.bind({}); | |||
NoAttributesSet.args = { | |||
ReturnFocusToOpenButton.args = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this story template specifying the .args
was wrong, so I just updated this to ReturnFocusToOpenButton
.
I just have this PR branch synced again with |
Contributes to #4985
Allow
<TearsheetShell>
to focus on elements matching CSS selectors specifiedWhat did you change?
Pass thru and join
<TearsheetShell selectorsFloatingMenus>
value to the underlying carbon<ComposedModal selectosFloatingMenus>
How did you test and verify your work?
I add the
selectorsFloatingMenus
property on the one of the story render property inTearsheet.stories.jsx
such like:Without the
#helloMan
being specified, the opened tearshet does not allow focusing on the input. When the selector is specified, the input can be focused and type inside.