Skip to content

Commit

Permalink
fix(locale-search): fix class fields error for inputTimeout (#12112)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

Closes #12087 (partially, see also #12088)

### Description

Fixes the following error reported when using react  wrapped components:

```
Error: The following properties on element c4d-locale-search will not trigger updates as expected because they are set using class fields: inputTimeout. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.
```

### Changelog

**Changed**

- Declare `inputTimeout` class property of `ThrottledInputMixin` as abstract, relying on children to implement.

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
m4olivei authored Nov 19, 2024
1 parent 1c28902 commit ec54fbe
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const ThrottledInputMixin = <T extends Constructor<HTMLElement>>(Base: T) => {
/**
* The throttle timeout to run query upon user input.
*/
inputTimeout = 200;
abstract inputTimeout: number;

connectedCallback() {
// TS seems to miss `HTMLElement.prototype.connectedCallback()` definition
Expand Down

0 comments on commit ec54fbe

Please sign in to comment.