Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FileUploader): remove invalid default role value #4209

Merged

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Oct 3, 2019

Closes #4208

Closes #4221

This PR moves invalid role attribute on file uploader input <label>s to their child <span>s or <div>s

Changelog

New

  • <span> with valid role attribute within <FileUploaderButton />

Changed

  • role attribute moved from file uploader <label> to child <span> or <div>

Testing / Reviewing

Ensure no DAP errors are thrown

@abbeyhrt
Copy link
Contributor

abbeyhrt commented Oct 3, 2019

Hey, sorry I didn't see that the other variants have the same DAP error, just was looking at the code in that PR, my bad. I'm gonna edit that issue I made to address the issue in the fileUploader itself and your PR (#3872) is good to go for this release! Sorry to add more work on your plate.

@netlify
Copy link

netlify bot commented Oct 3, 2019

Deploy preview for the-carbon-components ready!

Built with commit cdb909a

https://deploy-preview-4209--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Oct 3, 2019

Deploy preview for carbon-components-react ready!

Built with commit cdb909a

https://deploy-preview-4209--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Oct 3, 2019

Deploy preview for carbon-elements ready!

Built with commit cdb909a

https://deploy-preview-4209--carbon-elements.netlify.com

@emyarod
Copy link
Member Author

emyarod commented Oct 4, 2019

so do we want to just remove the role attribute entirely for all variants? if so I can update this PR for the legacy versions

I went ahead with the updates but if this is the solution we want to go with I can mark this as ready for review

@emyarod emyarod force-pushed the 4208-dnd-file-uploader-dap branch from 97e7d0f to c916b74 Compare October 4, 2019 14:10
@emyarod emyarod changed the title fix(FileUploaderDropContainer): remove invalid role attribute fix(FileUploader): remove invalid default role value Oct 4, 2019
@abbeyhrt
Copy link
Contributor

abbeyhrt commented Oct 4, 2019

Looking into it, I don't know if the ideal solution is just to remove the role="button" since the Add File is acting as a button. You don't have to do this since it's work that we will address on the A11y project but I'm thinking we would ideally change the label to a button or a div with role="button". Not sure if there are complications around that since I haven't tried it out yet.

@abbeyhrt
Copy link
Contributor

abbeyhrt commented Oct 4, 2019

what do you think @dakahn?

@emyarod
Copy link
Member Author

emyarod commented Oct 4, 2019

yeah the label is for the input element so I'm not sure if changing the label to a different element is something we want to do, but I'm just removing the invalid default value in this PR. it may not need a role at all though given how labels act as triggers for their corresponding inputs IIRC

@abbeyhrt
Copy link
Contributor

abbeyhrt commented Oct 4, 2019

It just makes the VO a bit weird, it announces it as a text element and doesn't tell you that it is interactive. It looks like the approach that accessible examples use it to have a span with the role of button as a child to the label and the span announces "Add files" and that it is a button to interact with. looking at this one here at least: https://codepen.io/accessabilly/pen/qNpZJg

@emyarod
Copy link
Member Author

emyarod commented Oct 4, 2019

sure I can make that change if that's the approach we want to take

@abbeyhrt
Copy link
Contributor

abbeyhrt commented Oct 4, 2019

Up to you, if you want to do this work. Like I said the a11y project can do this or we can wait for DA and see what he says, he'll definitely know more than me about all this lol

@emyarod
Copy link
Member Author

emyarod commented Oct 4, 2019

I originally opened this since it was identified as a release ship stopper but now that the issue's changed I'm ok with updating the PR to fit our new requirements

@dakahn
Copy link
Contributor

dakahn commented Oct 7, 2019

Sure! Yeah, let's go with @abbeyhrt's fix. Since you've been working in FileUploader land @emyarod it makes sense to have you bust this one out.

@emyarod emyarod force-pushed the 4208-dnd-file-uploader-dap branch from c916b74 to 0350748 Compare October 7, 2019 20:43
@emyarod emyarod marked this pull request as ready for review October 7, 2019 20:43
@emyarod emyarod requested a review from a team as a code owner October 7, 2019 20:43
@ghost ghost requested review from abbeyhrt and dakahn October 7, 2019 20:44
Copy link
Contributor

@abbeyhrt abbeyhrt left a comment

Choose a reason for hiding this comment

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

This looks great! Tested with VO and works perfectly, thanks for doing this!

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

LGTM 👍 - Thanks @emyarod!

@joshblack joshblack merged commit 198ccb0 into carbon-design-system:master Oct 8, 2019
@emyarod emyarod deleted the 4208-dnd-file-uploader-dap branch October 17, 2019 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AVT 1 - FileUploader (all examples) have DAP violation bug(fileUploader): has DAP violations
6 participants