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

feat: dropdown to watch for changes in default option prop #1317

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

sohonisaurabh
Copy link
Collaborator

Description

Dropdown component does not watch for changes in defaultOption prop, when this is changed programatically. This results in display of outdated selected option on UI.
This PR fixes this issue by adding a watcher for changes in defaultOption prop.

Related Issue

Motivation and Context

Discovered this issue while implementing user preferences pane in UX refresh

How Has This Been Tested?

Tested using built bundle in consumer code. And also via unit tests

Screenshots:

Before (If applicable):

After:

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sohonisaurabh sohonisaurabh requested a review from momeraj August 4, 2022 06:04
@sohonisaurabh sohonisaurabh self-assigned this Aug 4, 2022
@sohonisaurabh sohonisaurabh force-pushed the fix/dropdown-watch-for-changes branch from 91ef69b to 107a691 Compare August 4, 2022 06:05
@sohonisaurabh sohonisaurabh added the web component @momentum-ui/web-components label Aug 4, 2022
@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #1317 (671df63) into master (9692f80) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1317      +/-   ##
==========================================
- Coverage   94.10%   94.09%   -0.01%     
==========================================
  Files         132      132              
  Lines       17677    17684       +7     
  Branches     2647     2647              
==========================================
+ Hits        16635    16640       +5     
- Misses       1042     1044       +2     
Impacted Files Coverage Δ
web-components/src/components/dropdown/Dropdown.ts 88.84% <100.00%> (+0.15%) ⬆️
web-components/src/components/icon/Icon.ts 78.57% <0.00%> (-4.17%) ⬇️
web-components/src/mixins/RovingTabIndexMixin.ts 93.63% <0.00%> (-3.64%) ⬇️
...components/src/components/datepicker/DatePicker.ts 87.45% <0.00%> (-2.67%) ⬇️
web-components/src/components/input/Input.ts 98.87% <0.00%> (-0.38%) ⬇️
...nts/src/components/table-advanced/TableAdvanced.ts 88.10% <0.00%> (+0.46%) ⬆️
web-components/src/components/radio/Radio.ts 97.84% <0.00%> (+2.15%) ⬆️
web-components/src/components/tabs/Tab.ts 100.00% <0.00%> (+5.39%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@merajcal merajcal merged commit cf40391 into master Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web component @momentum-ui/web-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants