WebContainer position not updating

I have been attempting to update my web app to web 2.0 and am running into an issue.

if i update an WebContainer position via code either by directly affecting its position or updating the web style, the WebContainer moves. but when i click on it, it will jump back to it original position??

any thoughts

thanks

Adam

I just tried to replicate this and couldn’t. I added a WebContainer and Button to a page with the following in the button’s Pressed event:

WebContainer11.Left = WebContainer11.Left + 25

Clicking on the WebContainer in the browser did not result in it returning to its original position.

I then tried the following in the button’s Pressed event and also could not replicate this:

Var newLeft As Integer = ContainerControl11.Left + 25
ContainerControl11.Style.Value( "left" ) = newLeft.ToString( "#" ) + "px"

Can you upload a simple example project?

Add another button with this code:

WebContainer11.Style.BackgroundColor = color.blue

First press the button to move the container, then press the button to change the style and see it jump back to original position.

1 Like

Here is sample project.

1 Like

61536 - WebUIControl: Changing location is undone by visibility or contents change

1 Like

So this is considered a bug?

If so can you think of any way to update the position and have it stick.

Thanks

Adam

Ah. This is one of those painful re-render bugs. Yeah, I see it now. The good news is that it’s marked as fixed as of June 3, 2021 (thanks for the case ID, @AlbertoD ) so it may be in the next release.

Keep track of the position yourself and use the Style.Value left/top to do the movement, maybe?

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.