Hi,
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?
Hi,
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:
It's also quite helpful to include screenshots and code snippets where relevant.
The remaining dimension properties are read only but the enable property is read/write.
I found a use case where I don't want the breakpoint to switch.
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.
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.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.
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.
How to detect Scroll Bar width?
PrimaryView scroll values always shows 0 while scrolling.
I have an issue:
in my case, if a scroll appears (ex: vertical scrollbar), it does not reduce the width according to the scrollbar's width.
I tried all of the propertied under dimensions but none of them captures less width if scrollbar appears.
OBS: ViewPort and primary view reads the same values while updating can not figure out the difference in any scenario.
Enabled is true, never touched it.
I set to display all of them in a view, but even if scrollbar appears, it still reads 0 scroll values and probably the same reason is why dimensions of pimaryView neither viewport does not capture the reduced dimension while scrollbar activates itself while the window is resized.
All dimensions detects and shows changes while I resize the window.
I do some calculations that determine some displaying features of pipe connections between views and calculations go wrong because I'm unable to detect the reduced page width when scrollbar is present.
Or the scroll is not of the primary view itself if I have a docked view configured in the shared settings? even if {page.props.primaryView} says so?
I checked, and Dimensions of ViewPort and MainView both exclude the docked view's size.
I am not using or talking about popups as those are never the main view (if I 'm not wrong) and I guess dimensions of popups will never be detected.
found a workaround, but not sure if it's the proper way to do it:
managed to make it to detect the scrollBarwidth if I set the main view's root container's style overflow property to visible. but even in this case, none of the primaryView.scroll___ shows anything else than 0
is there any other approach?