fix tooltip formatter in react@ext

pull/629/head
Cory LaViska 2021-12-09 09:39:24 -05:00
rodzic 7d818c0590
commit 302f3b57c5
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -6,6 +6,10 @@ Components with the <sl-badge type="warning" pill>Experimental</sl-badge> 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 `<sl-range>` in JSX causes React@experimental to error out
## 2.0.0-beta.62
- 🚨 BREAKING: changed the `locale` attribute to `lang` in `<sl-format-bytes>`, `<sl-format-date>`, `<sl-format-number>`, and `<sl-relative-time>` to be consistent with how localization is handled

Wyświetl plik

@ -260,7 +260,11 @@ export default class SlRange extends LitElement {
@blur=${this.handleBlur}
/>
${this.tooltip !== 'none' && !this.disabled
? html` <output part="tooltip" class="range__tooltip"> ${this.tooltipFormatter(this.value)} </output> `
? html`
<output part="tooltip" class="range__tooltip">
${typeof this.tooltipFormatter === 'function' ? this.tooltipFormatter(this.value) : this.value}
</output>
`
: ''}
</div>
`