From 80c3d8784be8f68bde4a6f6c2b5be5cff2a96c4a Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 28 Oct 2024 13:39:12 -0400 Subject: [PATCH] improve range/tooltip perf; fixes #2064 (#2237) --- docs/pages/resources/changelog.md | 1 + src/components/range/range.component.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/pages/resources/changelog.md b/docs/pages/resources/changelog.md index 487f79b7e..520667fe3 100644 --- a/docs/pages/resources/changelog.md +++ b/docs/pages/resources/changelog.md @@ -17,6 +17,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti - Added support for Enter to `` to align with ARIA APG's [window splitter pattern](https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/) [#2234] - Fixed a bug in `` that caused the navigation icons to be reversed - Fixed a bug in `` that prevented label changes in `` from updating the controller [#1971] +- Improved performance of `` by skipping positioning logic when tooltip isn't shown [#2064] ## 2.18.0 diff --git a/src/components/range/range.component.ts b/src/components/range/range.component.ts index d779f83ab..c63fd4c0c 100644 --- a/src/components/range/range.component.ts +++ b/src/components/range/range.component.ts @@ -215,7 +215,7 @@ export default class SlRange extends ShoelaceElement implements ShoelaceFormCont this.syncProgress(percent); - if (this.tooltip !== 'none') { + if (this.tooltip !== 'none' && this.hasTooltip) { // Ensure updates are drawn before we sync the tooltip this.updateComplete.then(() => this.syncTooltip(percent)); }