-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
SplitButton bug and style enhancement #1179
Labels
bug
Something isn't working
Comments
When setting Width property, the icon not align to Right. |
newtype0096
added a commit
to newtype0096/wpfui
that referenced
this issue
Dec 23, 2024
* fix: ToggleButton interaction problem in SplitButton The flyout is displayed only when the button's image is clicked precisely, and this is inconvenient for the user.
7 tasks
newtype0096
added a commit
to newtype0096/wpfui
that referenced
this issue
Dec 23, 2024
* fix: ToggleButton interaction problem in SplitButton The flyout is displayed only when the button's image is clicked precisely, and this is inconvenient for the user.
pomianowski
added a commit
that referenced
this issue
Feb 1, 2025
* fix: ToggleButton interaction problem in SplitButton The flyout is displayed only when the button's image is clicked precisely, and this is inconvenient for the user. Co-authored-by: pomian <[email protected]>
pomianowski
added a commit
that referenced
this issue
Feb 1, 2025
* fix: ToggleButton interaction problem in SplitButton The flyout is displayed only when the button's image is clicked precisely, and this is inconvenient for the user. Co-authored-by: pomian <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
SplitButton bug
The toggle button part of the SplitButton stops working if you navigate away from a page and then come back to it using the PageService navigation and the page is registered using AddSingleton.
The problem appears to be how the toggle button Click event is registered and unregistered. The toggle button Click event is registered in the OnApplyTemplate routine which is only executed the first time the page is displayed. It's unregistered in an Unloaded event which executes every time you navigate away from the page, so the second and subsequent times you navigate to the page, the Click event is no longer registered and that part of the SplitButton stops working.
Style enhancement
On the style enhancement, the current style for the SplitButton has a large area of padding around the toggle button part. Unless you click exactly on the toggle button, the primary Click event fires rather than the toggle button Click event. This is confusing as you expect the toggle button to work if you click anywhere on the right side of the split. (See screen shot below).
I've included patches in the additional context area. If you need anything else, please let me know.
Also - thank you for this library and all the work you've put into it. It looks great and the overall design makes it easy and intuitive to work with.
To Reproduce
SplitButton bug
Style enhancement
Expected behavior
SplitButton bug
The toggle button part should always work no matter how many times you navigate away and back to the page.
Style enhancement
The toggle button Click event should fire when you click anywhere on the toggle button side of the split. It's really confusing to have the primary Click event fire unless you click exactly on the icon.
Screenshots
This is an example of the style issue. If you click anywhere outside of the red rectangle, the primary Click event fires. It's really confusing to have the primary Click even fire unless you click inside that small area. I think any user will expect the toggle button side to work if you click on any area on that side of the split.
OS version
OS Build: 22631.3880 (Windows 11 Pro 23H2)
.NET version
.NET 8
WPF-UI NuGet version
N/A - I was using libraries I compiled from the main branch.
Additional context
SplitButton.cs patch:
SplitButton.xaml patch:
The text was updated successfully, but these errors were encountered: