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(#909): Fixed issue where active elements within a shadowRoot would not be found by mask. #910

Closed

Conversation

andrewritchie
Copy link

Fixed an issue where active elements within a shadowRoot would not found by the mask service or directive, causing backspace to be handled improperly.

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: https://github.com/JsDaddy/ngx-mask/blob/develop/CONTRIBUTING.md#commit
  • Tests for the changes have been added (for bug fixes / features) - I do not believe sending a backspace keystroke to an input can be properly tested with Karma/Jasmine, no new unit tests has been added. Instead, an interactable component has been added to the bugs page.
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Mask directive and service use document.activeElement to determine the active input element, which does not account for active elements within a Shadow DOM

Issue Number: #909

What is the new behavior?

Mask directive and service use new method to recursively determine the activeElement of shadowRoots. If no shadowRoot is found for the the document's active element, the directive and service continues to behave as before.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@zouhirjob
Copy link

the fix seem working and no comment for this change

@NepipenkoIgor
Copy link
Collaborator

@andrewritchie Hi. Awesome fix. Could you make reverse merge from develop ?

@goranvujanovic
Copy link

Hi. Any idea when this fix will be merged?

@NepipenkoIgor
Copy link
Collaborator

@goranvujanovic Hi. Looks like the latest changes broke the whole library . Needed to revert and repeat all from scratch. Please make reverse merge from actual develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants