Software used:
- Elixir v1.10.2
- Phoenix 1.5.0-rc0
- LiveView 0.12.1
- macOS Cataline 10.15.4
- Tried on Safari and Firefox
I have a LiveView set up nicely with a chart (from Highcharts) showing some data. The chart is enclosed in a div with the phx-update="ignore"
attribute which works great. However, moving away from the current LiveView and coming back to it makes the chart disappear.
When I first visit the LiveView page:
After navigating away then coming back with <%= live_patch "Dashboard, ... %>
or <%= live_redirect "Dashboard", ... %>
:
dashboard_live.html.leex
:
<div phx-update="ignore" id="custom-chart">
<figure id="main-chart" class="highcharts-figure">
<div class="chart-container" id="<%= @chart_id %>"></div>
</figure>
<script id="main-chart-data">
....
</script>
</div>
The chart displays normally after I refresh the page.