diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index 5721e101..4d146212 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -6,6 +6,10 @@ Components with the Experimental badge _During the beta period, these restrictions may be relaxed in the event of a mission-critical bug._ 🐛 +## Next + +- Fixed bug where setting `tooltipFormatter` on `` in JSX causes React@experimental to error out + ## 2.0.0-beta.62 - 🚨 BREAKING: changed the `locale` attribute to `lang` in ``, ``, ``, and `` to be consistent with how localization is handled diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 8b2cd9a7..0d236974 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -260,7 +260,11 @@ export default class SlRange extends LitElement { @blur=${this.handleBlur} /> ${this.tooltip !== 'none' && !this.disabled - ? html` ${this.tooltipFormatter(this.value)} ` + ? html` + + ${typeof this.tooltipFormatter === 'function' ? this.tooltipFormatter(this.value) : this.value} + + ` : ''} `