Skip to content

Commit 2f06a59

Browse files
author
Luke Bowerman
authored
MessageBar should passthrough DOM properties (#1014)
1 parent 607f1ce commit 2f06a59

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
##[0.8.1]
8+
## [0.8.1]
99

10-
## Fixed
10+
### Fixed
1111

12+
- `MessageBar` needs to allow DOM properties to be passed through (aria support and the like)
1213
- Fix issue where InputDate did not render the correct month when setting a value prop
1314

1415
## [0.8.0]

packages/components/src/MessageBar/MessageBar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import { CompatibleHTMLProps, TypographyProps } from '@looker/design-tokens'
2828
import React, { forwardRef, Ref } from 'react'
2929
import styled from 'styled-components'
30+
import { omitStyledProps } from '@looker/design-tokens'
3031
import { IconButton } from '../Button'
3132
import { SimpleLayoutProps, simpleLayoutCSS } from '../Layout/utils/simple'
3233
import { getIntentLabel, Status } from '../Status'
@@ -54,13 +55,13 @@ const MessageBarLayout = forwardRef(
5455
id,
5556
children,
5657
canDismiss,
57-
className,
5858
intent = 'inform',
5959
onDismiss,
60+
...props
6061
}: MessageBarProps,
6162
ref: Ref<HTMLDivElement>
6263
) => (
63-
<div className={className} aria-live="polite" ref={ref} role="status">
64+
<div aria-live="polite" ref={ref} role="status" {...omitStyledProps(props)}>
6465
<Status intent={intent} />
6566
<MessageBarContent>{children}</MessageBarContent>
6667
{canDismiss && (

packages/design-tokens/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ export { prismTheme } from './prismTheme'
3636
// Useful external utilities
3737
export * from './customizeable_attributes'
3838
export * from './utils/animations'
39+
export * from './utils/omit'
3940
export { generateThemeFromCoreColors } from './utils/theme'

0 commit comments

Comments
 (0)