-
Notifications
You must be signed in to change notification settings - Fork 23
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
Input refs #144
Comments
At the moment the ref goes on the outermost element of the input component. Currently this is a div, wrapping the input and the label. I don't have a definite answer how we want to continue (or handle) these kind of features. Probably something like an extra prop like an Relates to #134 |
Ah I hadn't spotted the other issue, so I guess for me what is the expectation of how this should work currently? I have a feature I need to deliver this week so whatever the final solution is probably won't arrive in time for me to have my code behave in that way? If I depend on the html structure for now how likely is it that it'll break without warning? |
That is correct, we should first figure out how we can enable more customisation for the components that fit all teams and projects. For now, we don't have specific plans to change the structure of the input component, but please keep in mind that I cannot guarantee that the current structure will not change without a breaking change. |
I think you can rely on the HTML structure if you want to wrap this up as soon as possible due to the urgency of the feature. From what I see from the first proposal from @snapsnapturtle it seems that the change may be related to different props rather than a change on the HTML structure and even if we do such a thing we tend to be very cautious with breaking changes (which sometimes can play against us but favor you) In that sense, I will solve your issue using the current ref div and traversing from there if possible into the input. Then we need to have a longer conversation on regards the input ref |
I wonder if we should arrive at a consensus on where the |
I totally agree with you here that the |
Closing this in favor of #169 |
Support questions
I'm not sure if this is a bug or a feature so I'm asking this as a question.
If I pass a ref to an input component should this give me the input element itself OR another element within the component.
For reference I am trying to select the contents of an input when it's clicked so that it can be copied to the users' clipboard, see a code sandbox example here. In order to make this work I have to select the first child of the ref.
Is this behaviour correct and can I rely on the HTML structure not changing? Or is this a bug?
The text was updated successfully, but these errors were encountered: