-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Extended text masking function to include relevant HTMLElement #1310
Conversation
🦋 Changeset detectedLatest commit: 0c26420 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ix/text-masking-fn
+1 for this, really useful change |
Co-authored-by: Justin Halsall <[email protected]>
Co-authored-by: Justin Halsall <[email protected]>
@Juice10 made the changes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition @benjackwhite thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming suggestion
getElementFromNode
sounded like a built in getElementById
and hid the 'find parent' aspect.
the "closest" idea has precedence in https://developer.mozilla.org/en-US/docs/Web/API/Element/closest but maybe I'm overthinking it?
Co-authored-by: Eoghan Murray <[email protected]>
Co-authored-by: Eoghan Murray <[email protected]>
Co-authored-by: Eoghan Murray <[email protected]>
@eoghanmurray committed your changes (an then corrected the typos that I didn't initially notice 😅 ) |
…-io#1310) * Extends maskTextFn to pass the HTMLElement to the deciding function --------- Authored-by: benjackwhite <[email protected]> Co-authored-by: Justin Halsall <[email protected]> Co-authored-by: Eoghan Murray <[email protected]>
…-io#1310) * Extends maskTextFn to pass the HTMLElement to the deciding function --------- Authored-by: benjackwhite <[email protected]> Co-authored-by: Justin Halsall <[email protected]> Co-authored-by: Eoghan Murray <[email protected]>
A while back I added the element-to-be-masked to the masking function for inputs. This offers ultimate flexibility as the implementor can re-implement any of the other masking checks or any other thing they can come up with.
What was missing was the corresponding thing for text. This PR adds it.
For example it can solve the request in this issue without needing to add more, conflicting options.
With this example, everything will be masked except elements with the data attribute
rr-unmask
.