Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox item selection error occurred. #18

Closed
kdi0905 opened this issue Oct 7, 2024 · 5 comments
Closed

Checkbox item selection error occurred. #18

kdi0905 opened this issue Oct 7, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@kdi0905
Copy link

kdi0905 commented Oct 7, 2024

Hello, after updating to version 1.2.0, an issue occurred where the checkbox items cannot be selected. Is there a possible solution for this?

@MrJul MrJul added the bug Something isn't working label Oct 7, 2024
@MrJul
Copy link
Owner

MrJul commented Oct 7, 2024

Can you please share a simple Avalonia control that reproduces the problem?
The GameMenu sample, which uses several CheckBox in the options screen works without any issue.

If you're using a custom theme, make sure that there's a background color set on the control (even if it's Transparent) for hit testing to work correctly.

@kdi0905
Copy link
Author

kdi0905 commented Oct 8, 2024

I removed the existing controls except for the styles in the HellowWorld project and added a new ComboBox.
The code is as follows.

<UserControl
	xmlns="https://github.com/avaloniaui"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
	x:Class="HelloWorld.HelloWorldView"
	RenderOptions.TextRenderingMode="Antialias">

	<UserControl.Styles>
		<Style Selector="Border.anim">
			<Style.Animations>
				<Animation Duration="0:0:2" IterationCount="infinite" PlaybackDirection="Alternate">
					<KeyFrame Cue="0%">
						<Setter Property="Background" Value="#AAFF0000" />
					</KeyFrame>
					<KeyFrame Cue="100%">
						<Setter Property="Background" Value="#AA1E90FF" />
					</KeyFrame>
				</Animation>
			</Style.Animations>
		</Style>

	</UserControl.Styles>

	<ComboBox >
		<ComboBoxItem>
			a
		</ComboBoxItem>
		<ComboBoxItem>
			b
		</ComboBoxItem>
		<ComboBoxItem>
			c
		</ComboBoxItem>
		<ComboBoxItem>
			d
		</ComboBoxItem>
	</ComboBox>

</UserControl>

I commented out the line // ((HelloWorldView) Control!).FpsCounter.Text = $"FPS: {Engine.GetFramesPerSecond():F0}";.

@kdi0905 kdi0905 closed this as completed Oct 8, 2024
@kdi0905 kdi0905 reopened this Oct 8, 2024
@kdi0905
Copy link
Author

kdi0905 commented Oct 8, 2024

And after running the GameMenu project, I changed the UI Scale in the options, but I can't select fullscreen and vertical sync. Could you also check this?
image

It seems that after setting the UI scale to 140, I can't click anything.

@MrJul
Copy link
Owner

MrJul commented Oct 8, 2024

Ah, you meant ComboBox, not CheckBox! I can definitely reproduce, thank you.
These two issues are related after implementing #14. Let me fix that.

@MrJul
Copy link
Owner

MrJul commented Oct 8, 2024

Fixed by 25ab257
The fix is now available in v1.2.1.

@MrJul MrJul closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants