Skip to content

Conversation

@IASamoylov
Copy link
Contributor

@IASamoylov IASamoylov commented Feb 6, 2018

Pull request checklist

Description of changes

  • changed initialization attributed componentId, added default value this._id
  • changed initialization of the variable renderProps
  • changed render function for and
  • added test to check attribute

Ivan Samoylov added 2 commits February 7, 2018 01:49
+ changed initialization attributed componentId, added default value this._id
+ changed initialization of the variable renderProps
+ changed render function for <input/> and <area/>
+ added test to check attribute
@msftclas
Copy link

msftclas commented Feb 6, 2018

CLA assistant check
All CLA requirements met.

@IASamoylov IASamoylov changed the title Fixed support for the componentId attribute in component TextField [TextField] Fixed support for the componentId attribute in component TextField Feb 8, 2018
@dzearing
Copy link
Member

dzearing commented Feb 9, 2018

@micahgodbolt It looks like you added componentId months ago, but never actually put an id anywhere, so the label for attribute points to a missing component. This PR fixes it, which is good, but I also am not sure why we didn't do this:

  1. Use id for the input id. If none is provided, default to a generated one.
  2. Pass that in to the label's htmlFor.

Why would a consumer pass in id vs componentId? It isn't predictable and the documentation is unclear.

Copy link
Member

@dzearing dzearing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused why we aren't using id instead of componentId. Added question to @micahgodbolt

@IASamoylov
Copy link
Contributor Author

@dzearing, @micahgodbolt if we set TextField's "id" property manually, Label's property "for" value inside the component will not be modifed and still have default one

@IASamoylov
Copy link
Contributor Author

IASamoylov commented Feb 9, 2018

  1. Use id for the input id. If none is provided, default to a generated one.
  2. Pass that in to the label's htmlFor.

@dzearing, I fixed this issues

+ Used TextField's id for the input id. If none is provided, default to a generated one.
+ For a custom rendering function creates a new props with a new id (this._id)
@dzearing
Copy link
Member

I believe with the merge of #3896 we can close this one.

@dzearing dzearing closed this Mar 27, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TextField] Custom value for attribute componentId don't work in TextField

3 participants