-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
offsetParent is null when user applied "display: none" #997
Comments
Try using the botchat-es5.js file that you get after the build |
@Jake1996 This issue has nothing to do with ES6. This happens because a ref to an html element is null as the html element was not present in DOM due to |
Working on a fix that is broader than we thought. If the user hide it initally (thru But after a message is sent/received, it will goes back to normal. We need some more time to work on the size detection code. |
@Kartik1607 the fix is in PR #1003. But we still have a problem with size calculations, and that one could be one huge change:
Thus, we need to redo the measurement part by not making the screen flash. Or not doing measurement if not needed. |
@compulim by hiding webchat using css, on which css selector is display none applied? |
Anything on What's your scenario? |
In my case, we are using the custom build of webchat in an iframe on another page something like this. <div id="chat-frame" style="display:none;">
<iframe id="chatWindow"></iframe>
</div> After getting user information etc, we remove the At this point we get error at const maxContentWidth = (this.carouselActivity.messageDiv.offsetParent as HTMLElement).offsetWidth - paddedWidth; |
@Kartik1607 oh so you are hiding Web Chat until user profile is loaded? Instead of using |
When the user hide Web Chat using CSS style rules
display: none;
, theoffsetParent
become null and throw an exception. Hitting this line,History.tsx:59
.The text was updated successfully, but these errors were encountered: