yew-router's Link
should give access to the NodeRef
of the anchor element
#2876
athanclark
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's a simple concept - the
<Link<T>>
component from yew-router doesn't give full access to the internal<a>
tag. I think adding aref: NodeRef
field to theLinkProps
struct would be a good compromise.Example use case: a search bar. Because
<Link>
uses<a>
internally, and not<input type="submit">
, we'd have to manually emit a click event to the<a>
tag when a user presses theEnter
key after typing-in their search. This could be done by coercing theNodeRef
to aHtmlElement
, and callingclick()
.There is a pending PR for this request - #2877
Beta Was this translation helpful? Give feedback.
All reactions