Repository navigation
Closed
Labels
area/gridCategorizes an issue or PR as relevant to the Grid paneldifficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't workingproject/layout 🧱Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)
Description
Having 2 states
In the portrait, mode measure happens incorrectly
The same happens on WASM
Current behavior
When a piece of UI moves from one row and column of a Grid to another, then the row width is not recalculated
Expected behavior
Grid recalculates on children Grid.Row or Grid.Column changes
How to reproduce it (as minimally and precisely as possible)
https://github.com/xperiandri/Elmish.Uno/
SimpleCounter sample
Workaround
Maybe invalidating measure in code will work.
Environment
NuGet Package:
- Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
- Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
- Uno.SourceGenerationTasks
- Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
- Other:
NuGet Package Version(s):
<PackageReference Include="Elmish" Version="3.1.0" />
<PackageReference Include="FSharp.Control.FusionTasks" Version="2.0.2" />
<PackageReference Include="Uno.Core" Version="2.0.0" />
<PackageReference Include="Uno.UI" Version="3.0.17" />Affected platform(s):
- iOS
- Android
- WebAssembly
- WebAssembly renderers for Xamarin.Forms
- macOS
- Skia
- WPF
- GTK (Linux)
- Tizen
- Windows
- Build tasks
- Solution Templates
Reacted by Agnès ZITTE
Metadata
Metadata
Assignees
Labels
area/gridCategorizes an issue or PR as relevant to the Grid paneldifficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't workingproject/layout 🧱Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)






Activity
jeromelaban commentedon Oct 5, 2020
Grid.Row and Colunms updates generally work properly, but StateTriggers may not. Could you validate that the Grid.Row/Columns values are what you expect by adding a TextBlock like this in the xaml :
xperiandri commentedon Oct 5, 2020
Value changes. Otherwise, the grid wouldn't go to the down row
xperiandri commentedon Oct 5, 2020
The issue is that measure is not invalidated. Maybe because of Grid.Row/Column are set as animation
jeromelaban commentedon Oct 5, 2020
I'm not sure of what I see here, does the TextBlock displayed value change when the visual state changes ?
xperiandri commentedon Oct 5, 2020
Yes, the number
1in the top left corner is what you have asked to addxperiandri commentedon Oct 5, 2020
Here it is
0jeromelaban commentedon Oct 7, 2020
Thanks. If you can create a repro using the default Uno templates, It would help significantly.
xperiandri commentedon Oct 7, 2020
You are welcome
App2.zip
I don't understand why did you ask about that as it is a plain XAML. Which anyone can copy from https://github.com/xperiandri/Elmish.Uno/blob/622fba4da5e2e691cac6f7e39773d26241f4a149/src/Samples/Samples.Shared/SingleCounterPage.xaml and paste into a new project.
The key point of the issue is https://github.com/xperiandri/Elmish.Uno/blob/7c8325737995306036c131f93dcfbdef6834b83c/src/Samples/Samples.Shared/SingleCounterPage.xaml#L14
When
HorizontalAlignment="Center"then measure is incorrect.jeromelaban commentedon Oct 8, 2020
Thanks for the repro. We need those to avoid spending time recreating the issue that is generally not obvious.
In this case, the issue is not that the measure is not happening, but rather than the grid measures the textblock incorrectly. We're going to be updating the grid's source with the original WinUI's code, and this kind of behavior will disapear.
[-]Measure is not triggered on Grid.Row/Column property change[/-][+]Incorrect TextBlock measure in Grid[/+]xperiandri commentedon Oct 8, 2020
Cool!