Perspective - Breakpoint - Get view size

I spent some time testing this scenario and found some discrepancies in behaviors. I reached out to Dev and got an explanation that I thought I'd share here.

This can be done by using breakpoint containers, but it requires a very specific setup. @john.glynn suggested Message Handlers in the breakpoints, but you MUST use Embedded Views within the breakpoints, and then the Views you select to use for the Embedded View should have the different logic.

From Dev (paraphrased):

Both of a Breakpoint Container's children are essentially "running" at all times - even if you can't see them. However, the Views in use by Embedded Views are not "running" until the View is "mounted" (displayed in the browser).

So the Embedded View solution works with this setup:

Breakpoint Container
L__EmbeddedView
L__EmbeddedView_0

Then, EmbeddedView.props.path should be something like "SmallBreakpointListenerView", and EmbeddeView_0.props.path should be something like LargeBreakpointListenerView".

1 Like