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(PPDSC-2661): add controlled prop to Select #540

Merged
merged 12 commits into from
Jan 23, 2023

Conversation

mutebg
Copy link
Contributor

@mutebg mutebg commented Jan 4, 2023

PPDSC-2661

What

  1. Background - Depending on the use-case is possible that the component switches from uncontrolled and controlled. For example, when you want to have a controlled component without initial value ( since there is no value as "selected' it goes to uncontrolled mode ) and later you set value via <SelectOption selected /> that causes warning that components switches between modes.
  2. What did you do - added controlled prop which forces the select to be in controlled mode
  3. What does the reviewers should expect

I have done:

  • Written unit tests against changes
  • Written functional tests against the component and/or NewsKit site
  • Updated relevant documentation

I have tested manually:

  • The feature's functionality is working as expected on Chrome, Firefox, Safari and Edge
  • The screen reader reads and flows through the elements as expected.
  • There are no new errors in the browser console coming from this PR.
  • When visual test is not added, it renders correctly on different browsers and mobile viewports (Safari, Firefox, small mobile viewport, tablet)
  • The Playground feature is working as expected

Before:

After:

Who should review this PR:

How to test:

@github-actions github-actions bot added the fix This change fixes a bug label Jan 4, 2023
@mutebg mutebg added the ready for review Please assist in getting this reviewed label Jan 20, 2023
@mutebg mutebg marked this pull request as ready for review January 20, 2023 07:53
@mutebg mutebg requested a review from a team as a code owner January 20, 2023 07:53
Xin00163
Xin00163 previously approved these changes Jan 20, 2023
{
name: 'controlled',
type: 'boolean',
description: `Force Select component to controlled`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: `Force Select component to controlled`,
description: `Force Select component to be controlled`,

@mutebg mutebg merged commit 6f1cca2 into main Jan 23, 2023
@mutebg mutebg deleted the fix/PPDSC-2661-controlled-select-no-selected branch January 23, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix This change fixes a bug ready for review Please assist in getting this reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants