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

Consider removing FocusAsync method from HxInputBase #857

Open
jirikanda opened this issue Jul 15, 2024 · 0 comments
Open

Consider removing FocusAsync method from HxInputBase #857

jirikanda opened this issue Jul 15, 2024 · 0 comments

Comments

@jirikanda
Copy link
Contributor

  • Now, HxInputBase.FocusAsync focuses InputElement when it is set or throws exception if it is not set.
  • InputElement is set only in the descenants (in BuildRenderTree by AddElementReferenceCapture).
  • InputElement has no other reason.
  • InputElement is a protected property.

Issues:

  • The descendants do not know they should (must?) set value to the protected InputElement property.
  • The exception message is partialy wrong (they notice only part "focusing too early", not noticing "or InputElement is not set")

Suggestion:

  • Remove FocusAsync and InputElement property from HxInputBase and move FocusAsync method only to the components implementing it.
  • Or force implementations (HxInputBase descendant) to set InputElement.

FYI, @Arnnes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant