Skip to content

Commit

Permalink
fix: make area-hidden not false by "default" on #icon component
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Jan 25, 2019
1 parent b7843ea commit 18b16f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/dnb-ui-lib/src/components/icon/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ export default class Icon extends PureComponent {
let alt = _alt || title

if (!(alt && alt.length > 0)) {
alt = String(Icon.getIconNameFromComponent(props)).replace(/_/g, ' ')
alt = Icon.getIconNameFromComponent(props)
alt = alt ? String(alt).replace(/_/g, ' ') : null
}

// some wrapper params
Expand Down
17 changes: 9 additions & 8 deletions packages/dnb-ui-lib/src/components/icon/details.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
| Properties | Description |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `icon` | _(mandatory)_ a React SVG Component or the icon name (in case we use `IconPrimary` or `dnb-icon-primary`). |
| `alt` | _(mandatory)_ the alternative label (text version) of the icon. |
| `size` | _(optional)_ the dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium` or `large` |
| `color` | _(optional)_ sets a color property to the `svg` markup. Default is no color, witch means _black_ |
| `modifier` | _(optional)_ modifier class to define e.g. sizes. |
| `attributes` | _(optional)_ insert any other attributes. For example `disabled` or any other custom attributes. |
| Properties | Description |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `icon` | _(mandatory)_ a React SVG Component or the icon name (in case we use `IconPrimary` or `dnb-icon-primary`). |
| `alt` | _(mandatory)_ the alternative label (text version) of the icon. |
| `size` | _(optional)_ the dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium` or `large` |
| `color` | _(optional)_ sets a color property to the `svg` markup. Default is no color, witch means _black_ |
| `modifier` | _(optional)_ modifier class to define e.g. sizes. |
| `area_hidden` | _(optional)_ To declare that the icon should not be visible to screen readers. |
| `attributes` | _(optional)_ insert any other attributes. For example `disabled` or any other custom attributes. |

0 comments on commit 18b16f2

Please sign in to comment.