question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intermittent Selector Failure Using PropertyEquals

See original GitHub issue

Describe 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.

  1. 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>
    

    https://user-images.githubusercontent.com/17993847/236684642-705d5651-e006-4933-942b-89545e7167ed.mp4

    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).

  2. 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 in ColorView.

    <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>
    

    https://user-images.githubusercontent.com/17993847/236684791-068b7b43-64f3-4992-af94-b6c6667b777f.mp4

    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:open
  • Created 4 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
maxkatz6commented, May 19, 2023

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

1reaction
maxkatz6commented, May 19, 2023

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.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intermittent Selector failure - Help
Here is the selector I am using - it's a click activity: It works 6 out of 10 times. I have tried adding...
Read more >
jQuery Selector Returning "NaN" -- Intermittent
I'd think that if the myContainer object was bad in some way, it's length would be 0 or I'd get a different more...
Read more >
jQuery selector intermittent working, why?
A jQuery selection is a wrapper around the DOM object to make it easier to use. It doesn't have an id property, but...
Read more >
Changed error handling: Test always fails when click ...
I am in the process of attempting to update our large nightwatch codebase to v1. We have a custom command that attempts to...
Read more >
[#NDS-709] Dashboard e2e tests fail intermittently
Failed : No element found using locator: By(css selector, *[id="cloneKeyInput"]). Message: Failed: Cannot read property 'element' of undefined.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found