You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If focus() or any other function fail because it is run to early this is 100% a bug and an exception makes sure that the developers are informed of the bug. Correct usage will not cause an exception. Also if focus() can fail for more than one reason how do I know that reason from getting a boolean?
And even if so to me exceptions are way more clean than requiring testing with if's. Getting to collect error handling into a single try...catch is one of the beautiful things with C#. Especially as one need to surround code with try...catch statements anyway means that handling another error doesn't produce more error handling code.
Describe the bug
When calling Focus() from the constructor or OnInitialized it silently fails with weird behavior.
Also when calling Focus when a component or it's parent component has IsVisible == false this silently fails.
To Reproduce
Call Focus() from constructor, OnInitialized or when the component/parent is disabled.
Expected behavior
When Focus() cannot be performed an Exception should be thrown.
Avalonia version
11.1.3
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: