Extended text masking function to include relevant HTMLElement#1310
Extended text masking function to include relevant HTMLElement#1310eoghanmurray merged 13 commits intorrweb-io:masterfrom PostHog:fix/text-masking-fn
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 <Juice10@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
|
@Juice10 made the changes 👍 |
Juice10
left a comment
There was a problem hiding this comment.
Great addition @benjackwhite thanks!
eoghanmurray
left a comment
There was a problem hiding this comment.
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 <eoghan@getthere.ie>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
|
@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 <benjackwhite@users.noreply.github.com> Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com> Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
…-io#1310) * Extends maskTextFn to pass the HTMLElement to the deciding function --------- Authored-by: benjackwhite <benjackwhite@users.noreply.github.com> Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com> Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
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.