-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Initializing a Select with value immediately calls notifyChange handler #5783
Labels
Comments
copybara-service bot
pushed a commit
that referenced
this issue
Apr 29, 2020
…to options - Method `layout` and private method `updateLabel` have been collapsed into one `layout` method. The reasoning is partially to reduce redundancy, but also since there's no reason they should be updated separately. The old layout method may have simply been broken since it doesn't update the label, just the notch, but lack of usage meant this problem didn't surface. - `layoutOptions` method can now be called by the client whenever the underlying list elements change (i.e. dynamic server fetch), to ensure that the foundation's state is sync'ed up. When typeahead lands in list foundation, this will also allow an optional call to list's layout method to reinitialize typeahead cache. - The empty "" option is now properly accounted for as an option. Previously it was ignored, so if you initialized the select with "" having the selected class, it wouldn't be sync'ed to the internal state. This meant that selecting a different option via select.value="blah" wouldn't remove the "selected" classes and attributes on the "" option, meaning it would still act like "" is selected even though selected text shows up as "blah". - `foundation.init` is no longer called twice: once by base component.ts and once by select component.ts - `foundation.init` no longer calls `notchOutline` 3 (???) times (closes #5686) - `foundation.init` no longer emits change event (closes #5783). PiperOrigin-RevId: 308892334
copybara-service bot
pushed a commit
that referenced
this issue
Apr 29, 2020
…to options - Method `layout` and private method `updateLabel` have been collapsed into one `layout` method. The reasoning is partially to reduce redundancy, but also since there's no reason they should be updated separately. The old layout method may have simply been broken since it doesn't update the label, just the notch, but lack of usage meant this problem didn't surface. - `layoutOptions` method can now be called by the client whenever the underlying list elements change (i.e. dynamic server fetch), to ensure that the foundation's state is sync'ed up. When typeahead lands in list foundation, this will also allow an optional call to list's layout method to reinitialize typeahead cache. - The empty "" option is now properly accounted for as an option. Previously it was ignored, so if you initialized the select with "" having the selected class, it wouldn't be sync'ed to the internal state. This meant that selecting a different option via select.value="blah" wouldn't remove the "selected" classes and attributes on the "" option, meaning it would still act like "" is selected even though selected text shows up as "blah". - `foundation.init` is no longer called twice: once by base component.ts and once by select component.ts - `foundation.init` no longer calls `notchOutline` 3 (???) times (closes #5686) - `foundation.init` no longer emits change event (closes #5783). PiperOrigin-RevId: 308892334
copybara-service bot
pushed a commit
that referenced
this issue
Apr 29, 2020
…to options - Method `layout` and private method `updateLabel` have been collapsed into one `layout` method. The reasoning is partially to reduce redundancy, but also since there's no reason they should be updated separately. The old layout method may have simply been broken since it doesn't update the label, just the notch, but lack of usage meant this problem didn't surface. - `layoutOptions` method can now be called by the client whenever the underlying list elements change (i.e. dynamic server fetch), to ensure that the foundation's state is sync'ed up. When typeahead lands in list foundation, this will also allow an optional call to list's layout method to reinitialize typeahead cache. - The empty "" option is now properly accounted for as an option. Previously it was ignored, so if you initialized the select with "" having the selected class, it wouldn't be sync'ed to the internal state. This meant that selecting a different option via select.value="blah" wouldn't remove the "selected" classes and attributes on the "" option, meaning it would still act like "" is selected even though selected text shows up as "blah". (closes #5646) - `foundation.init` is no longer called twice: once by base component.ts and once by select component.ts - `foundation.init` no longer calls `notchOutline` 3 (???) times (closes #5686) - `foundation.init` no longer emits change event (closes #5783). PiperOrigin-RevId: 308892334
copybara-service bot
pushed a commit
that referenced
this issue
Apr 29, 2020
…to options - Method `layout` and private method `updateLabel` have been collapsed into one `layout` method. The reasoning is partially to reduce redundancy, but also since there's no reason they should be updated separately. The old layout method may have simply been broken since it doesn't update the label, just the notch, but lack of usage meant this problem didn't surface. - `layoutOptions` method can now be called by the client whenever the underlying list elements change (i.e. dynamic server fetch), to ensure that the foundation's state is sync'ed up. When typeahead lands in list foundation, this will also allow an optional call to list's layout method to reinitialize typeahead cache. (closes #5646) - The empty "" option is now properly accounted for as an option. Previously it was ignored, so if you initialized the select with "" having the selected class, it wouldn't be sync'ed to the internal state. This meant that selecting a different option via select.value="blah" wouldn't remove the "selected" classes and attributes on the "" option, meaning it would still act like "" is selected even though selected text shows up as "blah". (closes #5646) - `foundation.init` is no longer called twice: once by base component.ts and once by select component.ts - `foundation.init` no longer calls `notchOutline` 3 (???) times (closes #5686) - `foundation.init` no longer emits change event (closes #5783). PiperOrigin-RevId: 308892334
copybara-service bot
pushed a commit
that referenced
this issue
Apr 30, 2020
…to options - Method `layout` and private method `updateLabel` have been collapsed into one `layout` method. The reasoning is partially to reduce redundancy, but also since there's no reason they should be updated separately. The old layout method may have simply been broken since it doesn't update the label, just the notch, but lack of usage meant this problem didn't surface. - `layoutOptions` method can now be called by the client whenever the underlying list elements change (i.e. dynamic server fetch), to ensure that the foundation's state is sync'ed up. When typeahead lands in list foundation, this will also allow an optional call to list's layout method to reinitialize typeahead cache. (closes #5646) - The empty "" option is now properly accounted for as an option. Previously it was ignored, so if you initialized the select with "" having the selected class, it wouldn't be sync'ed to the internal state. This meant that selecting a different option via select.value="blah" wouldn't remove the "selected" classes and attributes on the "" option, meaning it would still act like "" is selected even though selected text shows up as "blah". (closes #5646) - `foundation.init` is no longer called twice: once by base component.ts and once by select component.ts - `foundation.init` no longer calls `notchOutline` 3 (???) times (closes #5686) - `foundation.init` no longer emits change event (closes #5783). PiperOrigin-RevId: 308892334
copybara-service bot
pushed a commit
that referenced
this issue
Apr 30, 2020
…to options - Method `layout` and private method `updateLabel` have been collapsed into one `layout` method. The reasoning is partially to reduce redundancy, but also since there's no reason they should be updated separately. The old layout method may have simply been broken since it doesn't update the label, just the notch, but lack of usage meant this problem didn't surface. - `layoutOptions` method can now be called by the client whenever the underlying list elements change (i.e. dynamic server fetch), to ensure that the foundation's state is sync'ed up. When typeahead lands in list foundation, this will also allow an optional call to list's layout method to reinitialize typeahead cache. (closes #5646) - The empty "" option is now properly accounted for as an option. Previously it was ignored, so if you initialized the select with "" having the selected class, it wouldn't be sync'ed to the internal state. This meant that selecting a different option via select.value="blah" wouldn't remove the "selected" classes and attributes on the "" option, meaning it would still act like "" is selected even though selected text shows up as "blah". (closes #5646) - `foundation.init` is no longer called twice: once by base component.ts and once by select component.ts - `foundation.init` no longer calls `notchOutline` 3 (???) times (closes #5686) - `foundation.init` no longer emits change event (closes #5783). PiperOrigin-RevId: 308892334
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a relatively confusing issue, I'll do my best to explain it.
material-components-web/packages/mdc-select/foundation.ts
Line 380 in 6a40ef2
The text was updated successfully, but these errors were encountered: