Skip to content
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

getUrl() returns old url to initTableau() when updating for isReportChanged == true #1

Open
whrazer opened this issue Sep 27, 2018 · 1 comment

Comments

@whrazer
Copy link

whrazer commented Sep 27, 2018

Not sure if anyone else has encountered this issue.

Have 2 buttons on website, clicking each one results in different url sent to TableauReport via props.
isReportChanged in componentWillReceiveProps(nextProps) is correctly set to true, but the initTableau() called inside ends up using the old url instead of the new one from nextProps.

Result is that when url1 changes to url2, old report from url1 reloads. If url1 is selected, then report from url2 is loaded, always lagging behind by showing the previous url if it has changed.

My quickfix: give initTableau an optional parameter, say customUrl with default value set to false.
If customUrl is not false, then set vizUrl to customUrl.
When calling initTableau from componentWillReceiveProps(), call initTableau with nextProps.url so it will use customUrl instead of the old url from getUrl().

Hope this helps someone.

Edit: Forgot to mention, this causes later requested reports to become invisible for some reason (visibility hidden, height and width 0), so be sure to use the options prop to fix that.

@Hartzi
Copy link

Hartzi commented Jun 11, 2019

Any update to this?

Probably the easiest workaround is just change react key every time the url changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants