diff --git a/changelog.md b/changelog.md index 2d86131..9cc33ad 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-01-16 - 1.4.1 - fix(consentsoftware-toggle) +Fix issue in drag event handling logic for the toggle component. + +- Corrected dragging functionality to accurately track dragging state. +- Included logic to delay the reset of the dragging state after toggling. + ## 2025-01-16 - 1.4.0 - feat(toggle component) Enhanced consent toggle component with drag functionality diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index ea3b311..4c9d7d7 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@consent.software/catalog', - version: '1.4.0', + version: '1.4.1', description: 'A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.' } diff --git a/ts_web/elements/consentsoftware-toggle.ts b/ts_web/elements/consentsoftware-toggle.ts index 4b45a83..ff3ce02 100644 --- a/ts_web/elements/consentsoftware-toggle.ts +++ b/ts_web/elements/consentsoftware-toggle.ts @@ -189,7 +189,6 @@ export class ConsentsoftwareToggle extends LitElement { // Start dragging this.isDragging = true; - this.hasDragged = false; // The difference between the pointer’s X and the knob’s current position this.startX = event.clientX - this.currentX; @@ -229,6 +228,9 @@ export class ConsentsoftwareToggle extends LitElement { // Dispatch toggle event this.dispatchEvent(new CustomEvent('toggle', { detail: { selected: this.selected } })); + delayFor(0).then(() => { + this.hasDragged = false; + }); } /**