Closed FerBarreraFraga closed 2 years ago
@Skope10 thanks for your report. Is your website publicly available so I could take I look or even better could you please provide us with a minimal reproducible example by any chance?
@Joozty here is a CSB link: https://codesandbox.io/s/mutable-rgb-xoorph?file=/src/App.tsx
To reproduce, select the input on the screen then wait ~5 seconds.
Changing the hidden input
field id
prop to anything but id
prevents the error from happening. As does removing the useSmartlook
hook.
@bscaspar Thanks a lot. It is really appreciated. I identified the problem and prepared a fix which will get released tomorrow at some point.
To describe the issue we record IDs of elements so they can be used in events filtering and many other places in our app. When you have a structure like this and you try to access the form's id via document.querySelector('#test').id
the result is not a string as one would expect but the input element itself which is not serializable in react's apps. We were aware of this behaviour but unfortunately did not cover it at all places. Obviously the most straightforward solution is using getAttribute
method.
<form id="test">
<input id="id">
</form>
Thanks again for your report and MRE. I will update you once it is released.
Sounds good thank you for the quick response!
@bscaspar fix is released. I am closing this one. If there is any problem feel free to reopen.
@Joozty should we look for a patch version of the package?
No need it should work without doing any changes in your codebase. This package is just a wrapper around our web-sdk script which is downloaded once you call initialize method.
The following error occurs after interacting with an input when I initialized Smartlook
This is how I initialize Smartlook: