Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixes
- Fix the behaviour of `AutoControlledComponent` when `undefined` is passed as a prop value @layershifter ([#499](https://github.com/stardust-ui/react/pull/499))
- Stop event propagation when press Escape on the popup @sophieH29 ([#515](https://github.com/stardust-ui/react/pull/515))
- Remove role="presentation" from `chatMessageBehavior` and `FocusZone` @sophieH29 ([#530](https://github.com/stardust-ui/react/pull/530))

### Documentation
- Add `Integrate Custom Components` guide page in the docs @mnajdova ([#517](https://github.com/stardust-ui/react/pull/517))
Expand Down
2 changes: 0 additions & 2 deletions src/lib/accessibility/Behaviors/Chat/chatMessageBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import { FocusZoneTabbableElements, FocusZoneDirection } from '../../FocusZone'

/**
* @description
* Adds role 'presentation' until we come up with final roles for chat.
* Sets the message to be a focusable element.
* Adds a vertical circular focus zone navigation where a user navigates using a Tab key.
* Adds a key action which prevents up and down arrow keys from navigating in FocusZone, we only want a Tab key to navigate.
*/
const chatMessageBehavior: Accessibility = (props: any) => ({
attributes: {
root: {
role: 'presentation',
[IS_FOCUSABLE_ATTRIBUTE]: true,
},
},
Expand Down
1 change: 1 addition & 0 deletions src/lib/accessibility/FocusZone/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This is a list of changes made to this Stardust copy of FocusZone in comparison
- With `defaultTabbableElement` prop set tab indexes are not updated accordingly ([#342](https://github.com/stardust-ui/react/pull/342))
- Remove unused prop `componentRef` ([#397](https://github.com/stardust-ui/react/pull/397))
- Fix `defaultTabbableElement` prop to be as a function ([#450](https://github.com/stardust-ui/react/pull/450))
- Remove role="presentation" @sophieH29 ([#530](https://github.com/stardust-ui/react/pull/530))

### Features
- Add embed mode for FocusZone and new Chat behavior ([#233](https://github.com/stardust-ui/react/pull/233))
Expand Down
1 change: 0 additions & 1 deletion src/lib/accessibility/FocusZone/FocusZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export class FocusZone extends React.Component<FocusZoneProps> implements IFocus

return (
<ElementType
role="presentation"
{...rest}
className={cx(FocusZone.className, className)}
data-focuszone-id={this._id}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/accessibility/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FocusTrapZoneProps, FocusZoneProps } from './FocusZone'
import { FocusTrapZoneProps, FocusZoneProps, IS_FOCUSABLE_ATTRIBUTE } from './FocusZone'

export type AriaWidgetRole =
| 'button'
Expand Down Expand Up @@ -126,6 +126,7 @@ export interface AriaRelationshipAttributes {
export interface AccessibilityAttributes extends AriaWidgetAttributes, AriaRelationshipAttributes {
role?: AriaRole
tabIndex?: string
[IS_FOCUSABLE_ATTRIBUTE]?: boolean
}

export type AccessibilityAttributesBySlot = { [partName: string]: AccessibilityAttributes }
Expand Down
1 change: 0 additions & 1 deletion test/specs/components/Chat/ChatMessage-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('ChatMessage', () => {

describe('accessibility', () => {
handlesAccessibility(ChatMessage, {
defaultRootRole: 'presentation',
focusZoneDefinition: (chatMessageBehavior as AccessibilityDefinition).focusZone,
})
})
Expand Down