You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The placeholder plugin adds a stylesheet with every placeholder widget. See this line. They are injected alongside the placeholder so that the styles will be applied even if the simpla-text instance is being used inside a Shadow Root.
However, this is naïve - instead there need only be 1 stylesheet per Shadow Root that any simpla-text is in. The plugin should check the view.root (which corresponds to the Shadow Root or document that the element lives in) and check if a style has already been applied e.g. via root.querySelector, or by storing it directly on the root e.g. root._placeholderStyles, or by using a WeakMap
The text was updated successfully, but these errors were encountered:
Should be noted that the downside to this is we'd be injecting DOM content into the client's DOM - injecting into the simpla-text light DOM is also running into the client's DOM, but that's less intrusive as we manage that DOM.
bedeoverend
changed the title
[v1] Don't adding unnecessary placeholder stylesheets
[v1] Don't add unnecessary placeholder stylesheets
Mar 29, 2017
madeleineostoja
changed the title
[v1] Don't add unnecessary placeholder stylesheets
Don't add unnecessary placeholder stylesheets
Apr 12, 2017
The placeholder plugin adds a stylesheet with every placeholder widget. See this line. They are injected alongside the placeholder so that the styles will be applied even if the
simpla-text
instance is being used inside a Shadow Root.However, this is naïve - instead there need only be 1 stylesheet per Shadow Root that any simpla-text is in. The plugin should check the
view.root
(which corresponds to the Shadow Root or document that the element lives in) and check if a style has already been applied e.g. viaroot.querySelector
, or by storing it directly on theroot
e.g.root._placeholderStyles
, or by using aWeakMap
The text was updated successfully, but these errors were encountered: