-
Notifications
You must be signed in to change notification settings - Fork 601
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: ensure StyleElementCustomPropertyManager works with disconnected elements #4112
Merged
nicholasrice
merged 5 commits into
master
from
users/nirice/fix-disconnected-style-element-property-manager-creation
Nov 16, 2020
Merged
fix: ensure StyleElementCustomPropertyManager works with disconnected elements #4112
nicholasrice
merged 5 commits into
master
from
users/nirice/fix-disconnected-style-element-property-manager-creation
Nov 16, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicholasrice
requested review from
awentzel,
chrisdholt,
EisenbergEffect,
Falkicon and
janechu
as code owners
November 10, 2020 22:50
…t-property-manager-creation
scomea
approved these changes
Nov 11, 2020
EisenbergEffect
suggested changes
Nov 12, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thing I'm not quite sure about. If we can resolve that, I can approve.
packages/web-components/fast-foundation/src/custom-properties/manager.ts
Outdated
Show resolved
Hide resolved
marjonlynch
approved these changes
Nov 13, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely fixes the issue in firefox, smoked
janechu
approved these changes
Nov 16, 2020
EisenbergEffect
approved these changes
Nov 16, 2020
…t-property-manager-creation
nicholasrice
deleted the
users/nirice/fix-disconnected-style-element-property-manager-creation
branch
November 16, 2020 22:12
This was referenced Sep 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change adds behaviors that allows using the
StyleElementCustomPropertyManager
with a client element that is not connected.fixes #4109
Motivation & context
Prior to this change, calling
document.createElement('fast-design-system-provider')
in FireFox would cause theStyleElementCustomPropertyManager
to throw because it would attempt to access a property ofnull
. The property isnull
when the<style>
element provided to the manager is not connected to the DOM, which happens during programmatic creation of thefast-design-system-provider
because the DSP itself is disconnected from the DOM.This change checks if the problematic property is null, and if so, it attaches a subscriber to the
isConnected
property of the element's controller. When the subscriber invokes, only then is the customPropertyTarget accessed and assigned.Issue type checklist
Is this a breaking change?
Adding or modifying component(s) in
@microsoft/fast-components
checklistProcess & policy checklist