forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DropdownMenu): Add responsive menu alignment (react-bootstrap#5307)
* feat(DropdownMenu): Add responsive menu alignment * Apply suggestions * Allow "left" and "right" to be used in the align prop Add deprecation notice for alignRight in DropdownMenu * Remove DEVICE_SIZES in favor of Object.keys * Add comment to clarify responsive left align requires dropdown-menu-right class * Fix so that only 1 breakpoint is allowed when using responsive align * Fix menuAlign types * Fix TS types
- Loading branch information
Showing
8 changed files
with
186 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<> | ||
<div> | ||
<DropdownButton | ||
as={ButtonGroup} | ||
menuAlign={{ lg: 'right' }} | ||
title="Left-aligned but right aligned when large screen" | ||
id="dropdown-menu-align-responsive-1" | ||
> | ||
<Dropdown.Item eventKey="1">Action 1</Dropdown.Item> | ||
<Dropdown.Item eventKey="2">Action 2</Dropdown.Item> | ||
</DropdownButton> | ||
</div> | ||
<div className="mt-2"> | ||
<SplitButton | ||
menuAlign={{ lg: 'left' }} | ||
title="Right-aligned but left aligned when large screen" | ||
id="dropdown-menu-align-responsive-2" | ||
> | ||
<Dropdown.Item eventKey="1">Action 1</Dropdown.Item> | ||
<Dropdown.Item eventKey="2">Action 2</Dropdown.Item> | ||
</SplitButton> | ||
</div> | ||
</>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<DropdownButton | ||
alignRight | ||
menuAlign="right" | ||
title="Dropdown right" | ||
id="dropdown-menu-align-right" | ||
> | ||
|
Oops, something went wrong.