Page Properties dimensions enabled


I was wondering if I can stop a breakpoint view from switching views by turning off this page property. I tested it and it doesn't work that way. What is the intention of this property?

In the dimensions section of the docs from your link, it describes the page.props.dimension.enabled property as read-only:

The page dimensions in this object will update accordingly if true. While false, the dimension values will not update.
The remaining dimension properties in this section are read-only.

The purpose of most of the page properties are to give you contextual information about the user's screen, so you can use that info to make formatting decisions.

If you're trying to make a breakpoint view not switch at the breakpoint, then you probably don't want to use a breakpoint view. I think we'll be able to help you better if you describe:

  1. The problem you're trying to solve
  2. The method(s) you've tried already
  3. What you'd like help with

It's also quite helpful to include screenshots and code snippets where relevant.

1 Like

The remaining dimension properties are read only but the enable property is read/write.

  1. I found a use case where I don't want the breakpoint to switch.

  2. Enabling disabling that bit. I can see that the dimensions don't change when the bit is disabled but it won't prevent the breakpoint view from switching.

  1. What is this use case? Can you share a picture or example with us?
  2. The key part in the docs is when it says "The page dimensions in this object will update accordingly if true." Meaning that turning the enable bit to False only stops the dimension properties from updating, not that it stops the dimensions themselves from updating. The user controls the size of their view by adjusting the size of their browser. That isn't something we can control from Perspective.
1 Like

That isn't its purpose. Its purpose is to gather information from the browser about the view dimensions and feed that back to the gateway for expressions and scripts to use. There's substantial overhead for that, so the transmission of that information is controlled by the enabled property. Don't turn it on if you don't need the information. Gathering the information, by itself, doesn't change anything else about the view.

1 Like

Thanks @pturmel
I just find it weird that it just controls the transmission of information.

Transmitting the information is expensive in bandwidth and CPU usage. Designs that depend on this information will be latency-sensitive and potentially visually glitchy, so should be avoided when possible. Let the browser do its thing.

1 Like