Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect element reference in InlangVariant event binding #3392

Merged

Conversation

felixhaeberle
Copy link
Collaborator

Change Summary

The update corrects an incorrect element reference in inlang-variant.ts, ensuring that the event target properly matches the expected element.

Detailed Diff Analysis

  • File: inlang/packages/ui-components/editor-component/src/stories/variant/inlang-variant.ts
  • Lines Modified: 163-169
  • Changes Made:
    • Before:
      const element = this.shadowRoot?.getElementById(
        `${this.variant.id}-${match}`
      );
    • After:
      const element = this.shadowRoot?.getElementById(
        `${this.variant.id}-${match.key}`
      );
    • Issue Fixed:
      • Previously, match was used directly in the element ID.
      • The correct property to reference is match.key, ensuring proper retrieval of the associated element.
    • Impact: Fixes event binding issues where the variant was not emitting the event correctly due to mismatched element references.

Key Takeaway

This fix ensures that the @sl-blur event is correctly linked to the expected UI element, preventing potential UI inconsistencies or event misfires.

Copy link

changeset-bot bot commented Feb 11, 2025

⚠️ No Changeset found

Latest commit: 807e15c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@felixhaeberle felixhaeberle merged commit a2c9521 into sherlock-new-editor Feb 11, 2025
1 check passed
@felixhaeberle felixhaeberle deleted the sherl-165-editing-selector-values branch February 11, 2025 14:15
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant