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: select form control status dirtied on initial value and patchValue #278

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

thatsamsonkid
Copy link
Collaborator

@thatsamsonkid thatsamsonkid commented Apr 25, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Currently just adds more test related to select's form control

Which package are you modifying?

  • accordion
  • alert
  • alert-dialog
  • aspect-ratio
  • avatar
  • badge
  • button
  • calendar
  • card
  • checkbox
  • collapsible
  • combobox
  • command
  • context-menu
  • data-table
  • date-picker
  • dialog
  • dropdown-menu
  • hover-card
  • icon
  • input
  • label
  • menubar
  • navigation-menu
  • pagination
  • popover
  • progress
  • radio-group
  • scroll-area
  • select
  • separator
  • sheet
  • skeleton
  • slider
  • sonner
  • spinner
  • switch
  • table
  • tabs
  • textarea
  • toast
  • toggle
  • tooltip
  • typography

What is the current behavior?

Closes #224

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@thatsamsonkid thatsamsonkid changed the title test: select form control status fix: select form control status dirtied on initial value and patchValue May 25, 2024
@thatsamsonkid thatsamsonkid marked this pull request as ready for review May 25, 2024 15:12
@thatsamsonkid
Copy link
Collaborator Author

thatsamsonkid commented May 25, 2024

Alright finally hopefully resolving this, keep me honest here i'm pretty sure this make sense. I've been spending some time in the material repo and playing around with mat-select component. I have below stackblitz for the material one if in case you guys find it helpful

https://stackblitz.com/edit/iwefen?file=src%2Fexample%2Fselect-error-state-matcher-example.ts

Apart from the fix also open to suggestions for how we can better organize the tests for select if anyone has any ideas especially since I added a bunch here for each scenario (single mode, multi-mode and required and initial value variants). But I also question if we need them all because we apply the statuses directly from ng control so its not really our logic per say. The root issue here was related more to when we triggered the form change. But yea let me know what you guys think

@goetzrobin @elite-benni

@thatsamsonkid
Copy link
Collaborator Author

Need to rebase once #293 goes in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The select control become dirty on multiple mode with initlal value or patch value
1 participant