-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix badge truncation when a `<button>` * Added innerText to title attribute * Fix truncation if button is the child * Max width accounts for padding, etc. * Some more fixes - Added docs example for truncations - Duplicated the `aria-label` as the `title` on the clickable icon - Keeping the `ref` and `title` attributes to the same element as `…rest` so they can be overridden - Fix max width of badges with onClick and iconOnClick - Fix text alignment - Change cursor to default unless clickable
- Loading branch information
Showing
6 changed files
with
143 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
|
||
import { EuiBadge, EuiPanel, EuiSpacer } from '../../../../src/components'; | ||
|
||
export default () => ( | ||
<EuiPanel style={{ maxWidth: 200 }}> | ||
<EuiBadge>Badge with simple text being truncated</EuiBadge> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiBadge iconType="clock">Badge with icon being truncated</EuiBadge> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiBadge onClick={() => {}} onClickAriaLabel="Click this badge to..."> | ||
Badge with onClick being truncated | ||
</EuiBadge> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiBadge | ||
iconType="cross" | ||
iconSide="right" | ||
iconOnClick={() => {}} | ||
iconOnClickAriaLabel="Click this icon to..."> | ||
Badge with iconOnClick being truncated | ||
</EuiBadge> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiBadge | ||
iconType="cross" | ||
iconSide="right" | ||
onClick={() => {}} | ||
onClickAriaLabel="Click this badge to..." | ||
iconOnClick={() => {}} | ||
iconOnClickAriaLabel="Click this icon to..."> | ||
Badge with both onClicks being truncated | ||
</EuiBadge> | ||
</EuiPanel> | ||
); |
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