mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
fix(textfield,focus,ripple): fix textfield SSR
PiperOrigin-RevId: 566863561
This commit is contained in:
parent
e1a04a158a
commit
f576b60aec
@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {LitElement, PropertyValues} from 'lit';
|
||||
import {isServer, LitElement, PropertyValues} from 'lit';
|
||||
import {property} from 'lit/decorators.js';
|
||||
|
||||
import {Attachable, AttachableController} from '../../internal/controller/attachable-controller.js';
|
||||
@ -87,6 +87,8 @@ export class FocusRing extends LitElement implements Attachable {
|
||||
}
|
||||
|
||||
private onControlChange(prev: HTMLElement|null, next: HTMLElement|null) {
|
||||
if (isServer) return;
|
||||
|
||||
for (const event of EVENTS) {
|
||||
prev?.removeEventListener(event, this);
|
||||
next?.addEventListener(event, this);
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {html, LitElement, PropertyValues} from 'lit';
|
||||
import {html, isServer, LitElement, PropertyValues} from 'lit';
|
||||
import {property, query, state} from 'lit/decorators.js';
|
||||
import {classMap} from 'lit/directives/class-map.js';
|
||||
|
||||
@ -452,6 +452,8 @@ export class Ripple extends LitElement implements Attachable {
|
||||
}
|
||||
|
||||
private onControlChange(prev: HTMLElement|null, next: HTMLElement|null) {
|
||||
if (isServer) return;
|
||||
|
||||
for (const event of EVENTS) {
|
||||
prev?.removeEventListener(event, this);
|
||||
next?.addEventListener(event, this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user