-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[drift] Update Drift Storybook to apply context, fix bug #139510
[drift] Update Drift Storybook to apply context, fix bug #139510
Conversation
So running on this branch, looks like this resolves the issue with storybook for me, at least on chrome. Firefox fails but that seems to be due to this, still investigating. Safari is still failing and |
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.
Did not run this locally, but code changes LGTM
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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.
Pulled and tested, works in Chrome, Firefox and Safari 🎉
* [drift] Update Drift Storybook to apply context * A few tweaks Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit af42246)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Summary
The Storybook example for Drift chat was lacking the context provider, which in turn provides parameters to Drift chat. This PR fixes that issue, and adds argument fields to configure Drift. It also fixes a bug where Drift may not appear.
The bug
While working on this, I discovered a bug/change that sometimes prevents Drift from being displayed completely. When I wrote this (in #123772), Drift would "bounce around" unless we waited for the
driftIframeResize
event to fire. At some point between that PR and now,driftIframeResize
doesn't always fire, so the chat window doesn't become visible.The fix
iframe
to0
, rather than usevisibility
to maintain its state.visibility
to maintain the state of the 'Hide chat` button, and only that button.Testing Notes
You have to be sure there's a
localhost
enabled playbook for Storybook to work.