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(content-switcher): call onChange with correct data with keyboard #6257

Conversation

joshblack
Copy link
Contributor

Closes #6119

Changelog

New

Changed

  • Update content switcher to call onChange with correct data when using keyboard
  • Added tests for behavior to prevent regression

Removed

@joshblack joshblack requested a review from a team as a code owner June 11, 2020 19:39
@ghost ghost requested review from emyarod and tw15egan June 11, 2020 19:39
@netlify
Copy link

netlify bot commented Jun 11, 2020

Deploy preview for carbon-elements ready!

Built with commit 5c43d8c

https://deploy-preview-6257--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Jun 11, 2020

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit 5c43d8c

https://deploy-preview-6257--carbon-components-react.netlify.app

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

is this technically a breaking change? related #6162

@joshblack
Copy link
Contributor Author

@emyarod good point, was thinking about that after seeing that proposal today.

I think technically it is, but the previous behavior is wrong so I wasn't sure what the right way forward may be.

@emyarod
Copy link
Member

emyarod commented Jun 12, 2020

I think we just need to treat it as a breaking change (related previous incidents in the website and design language website carbon-design-system/carbon-website#119 carbon-design-system/design-language-website#273)

@tw15egan
Copy link
Collaborator

So is this being postponed until v11?

@joshblack
Copy link
Contributor Author

Maybe the best question to ask here is if someone could use the as-is to implement a correct content switcher, or if it'd be too hard for the typical case?

It seems like it'd be challenging to use the incorrect behavior here with a code switcher, maybe you'd need to pass in onKeyDown with the onChange potentially?

The reason this comes up is that if it's unreasonable for folks to implement/build a fix on top of the breaking behavior, then we could move forward with the change (since so no would be able to use it) but if there is an alternative way then we could rope this behind a feature flag, for sure.

@tw15egan
Copy link
Collaborator

I think if we communicate the reason for the breaking change (the behavior was impossible/difficult to implement as-is) then I'm okay with it.

@joshblack
Copy link
Contributor Author

Cool, @emyarod said something similar over in Slack too. I think we could make a case for this being a justified change given that the behavior is incorrect, and achieving the correct behavior is difficult.

Let's go ahead and do that, I'll make sure to post a quick note too in our channel tomorrow.

@aledavila
Copy link
Contributor

Is this something we want to start documetning in our code tabs. maybe at the bottom changes in x.x.x this was changed to get the behavior correctly? it seems like people never read our releases. Or as long as we communicate it in the release we can point them there ?

@joshblack
Copy link
Contributor Author

bump @emyarod @tw15egan @aledavila when you get a chance 👀

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

the change is fine. if we are pushing this ASAP we just need to be clear that it is a breaking change since this exact issue with content switcher has affected consumers like our own Carbon website multiple times (in the tickets I referenced)

Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

Also good with the changes since this is making the correct implementation difficult. It would be great if we make sure we have some messaging around this so we don't break users without letting them know!

@reeteshsingh93
Copy link

When can we expect this to get in?

@kodiakhq kodiakhq bot merged commit 365aa05 into carbon-design-system:master Nov 5, 2020
@reeteshsingh
Copy link

Issue still persist

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.

Contentswitcher, onChange() event has wrong values when using arrow keys #1814
7 participants