Skip to content

SwatchColorPicker: Adding Aria Label Text#3765

Merged
jspurlin merged 9 commits into
microsoft:masterfrom
chang47:chiechan/accColor
Jan 30, 2018
Merged

SwatchColorPicker: Adding Aria Label Text#3765
jspurlin merged 9 commits into
microsoft:masterfrom
chang47:chiechan/accColor

Conversation

@chang47

@chang47 chang47 commented Jan 23, 2018

Copy link
Copy Markdown
Contributor

Description of changes

Currently our swatch color picker doesn't have an option to enable aria-label text. Added support to pass in an aria-label from the SwatchColorPicker and the Grid component that is being used as a base.

Focus areas to test

Swatch Color Picker page.

getStyles,
} = this.props;

const htmlProps = getNativeProps(this.props, htmlElementProperties, ['data']);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an overridden data prop on SwatchColorPicker? If not, then you don't need the third param

@jspurlin jspurlin Jan 24, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need to get the native props here? Couldn't we just spread the props we were given until we get into Grid and then get the nativeProps. Note: you'd want to make sure any of the props that map to native html attributes we want overriden or that we are changing props as part of the creation of the Grid in the SwatchColorPicker to be defined after the spread (e.g. items, onBlur, and theme for example). To keep it clean, it's best to do the spread first and then have all of our specific props to override them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, there were no particular reason for this. I made an assumption that it was needed based off the ResizeGroup PR, but you're right, it's not needed.

columnCount={ columnCount }
onRenderItem={ this._renderOption }
positionInSet={ positionInSet && positionInSet }
setSize={ setSize && setSize }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did these get move in front of htmlProps? If it's because those are getting return as part of the htmlProps, then you might want to consider including those attributes in the exclude list in the getNativeProps call

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, I'll exclude it. I was thinking that we should no longer set these types manually and was trying to push to use the native supported for aria attributes.

getStyles,
} = this.props;

const htmlProps = getNativeProps(this.props, htmlElementProperties, ['aria-posinset, aria-setsize']);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this here, could you just pass { ...this.props } to Grid and then do the trimming there?

@jspurlin jspurlin merged commit 2a554f6 into microsoft:master Jan 30, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants