Intermittent Selector Failure Using PropertyEquals
See original GitHub issueDescribe the bug
To Reproduce
I’m merging the reproduction, expected behavior and screenshots sections together to make this easier to follow. There are a few different cases here.
Firstly, this was encountered with the #11264 PR so all repro should use that branch.
-
Within ColorView (a normal control scenario) the following selectors are applied intermittently.
<Style Selector="^ /template/ primitives|ColorSlider#Component1Slider[ColorModel=Rgba]"> <Setter Property="IsPerceptive" Value="False" /> </Style> <Style Selector="^ /template/ primitives|ColorSlider#Component2Slider[ColorModel=Rgba]"> <Setter Property="IsPerceptive" Value="False" /> </Style> <Style Selector="^ /template/ primitives|ColorSlider#Component3Slider[ColorModel=Rgba]"> <Setter Property="IsPerceptive" Value="False" /> </Style>
Note that switching between Hsva and Rgba color models should apply/remove the style accordingly. This works sometimes but other times does not. There seems to be no clear pattern here. In the screen capture this is made visible by the slider gradient backgrounds changing color even with the same color model (clearest to see in RGB where if
IsPerceptive=True
the gradients will ONLY be red/green/blue). -
Within
ColorPicker
– a control with the majority of its content hosted within a popup/flyout – NONE of the selectors seem to be applied. This includes one more selector that works inColorView
.<Style Selector="^ /template/ primitives|ColorSlider#ColorSpectrumThirdComponentSlider[ColorComponent=Component1]"> <Setter Property="IsPerceptive" Value="True" /> </Style> <Style Selector="^ /template/ primitives|ColorSlider#Component1Slider[ColorModel=Rgba]"> <Setter Property="IsPerceptive" Value="False" /> </Style> <Style Selector="^ /template/ primitives|ColorSlider#Component2Slider[ColorModel=Rgba]"> <Setter Property="IsPerceptive" Value="False" /> </Style> <Style Selector="^ /template/ primitives|ColorSlider#Component3Slider[ColorModel=Rgba]"> <Setter Property="IsPerceptive" Value="False" /> </Style>
This is NOT intermittent and just always fails to apply the selectors within a popup/flyout. The RGB component sliders should not be red/green/blue (IsPerceptive=True) they should appear as the sliders in the ColorView visible before the popup/flyout is opened.
Desktop (please complete the following information):
- OS: Windows 10 Pro
- Version: Master 11.0-preview7+ at 8ffbbb7dca6b89773da89a54e42bb64bf089d5f5
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 months ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Added pseudoclasses to see if it helps to find a problem. Apparently there is something with dev tools or we got quantum mechanics observer effect. Selecting node in the dev tools tree changes its behavior.
https://github.com/AvaloniaUI/Avalonia/assets/3163374/56a25829-c822-4484-895b-276c6358f4b2
I don’t think it’s something with async rendering, as even in dev tools IsPerceptive value is changing randomly. And set “Priority” is just lying there. I.e. it can say “LocalValue”, when I removed local value from the ColorView.xaml and it could only be either Unset (=true by default) or set from style trigger (false). And style is not applied when it is expected to.