Skip to content

Consider removing FocusAsync method from HxInputBase #857

@jirikanda

Description

@jirikanda
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions