Repository navigation
Textbox improvements - #981
Merged
Merged
Conversation
Member
Author
|
Ready for review! |
shiftkey
approved these changes
Feb 27, 2017
|
|
||
| if (__DEV__) { | ||
| if (activeIds.size > 50) { | ||
| console.warn(`Id pool contains ${activeIds.size} entries, it's possible that id's aren't being released properly.`) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * | ||
| * This differs from the onChange event in that it passes only the new | ||
| * value and not the event itself. Subscribe to the onChange event if you | ||
| * need the ability to prevent the action from occurring. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| label='Password' | ||
| type='password' | ||
| disabled={disabled} | ||
| onChange={this.onPasswordChange} |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * An optional className to be applied to the rendered | ||
| * top level element of the component. | ||
| */ | ||
| readonly className?: string |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| /** | ||
| * An automatically generated id for the input element used to reference | ||
| * it from the label element. This is generated once when the component | ||
| * is mounted. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * An optional text for a link label element. A link label is, for the purposes | ||
| * of this control an anchor element that's rendered alongside (ie on the same) | ||
| * row as the the label element. The link label will only be rendered if the | ||
| * textbox has a label text. This is used for presenting the user with a contextual |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Member
Author
|
🔵 |
Merged
niik
added a commit
that referenced
this pull request
Jun 29, 2022
This was introduced in #981 and is only used in one location, 2FA input. As 2FA input in app is exceedingly rare these days with mandatory web flow login we can remove it and at the same time solve a layout issue with very long labels which would previously overflow.
s7ab059789
pushed a commit
to s7ab059789/desktop
that referenced
this pull request
Sep 18, 2022
This was introduced in desktop#981 and is only used in one location, 2FA input. As 2FA input in app is exceedingly rare these days with mandatory web flow login we can remove it and at the same time solve a layout issue with very long labels which would previously overflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are changes that I need for #961 but I'm breaking them out to make it a little easier to review.
This reworks the TextBox component to only render a label element if a label text has been provided. It also adds the ability for us to incorporate a label link element as seen below. This matches the behavior of GitHub.com.
In order to be able to unwrap the input element from the label I had to use the
forattribute to associate the two and thus I needed a unique html id for the input element. Rather than requiring one to be passed down I first opted for a simple uuid but later refined it a little to be able to generate semi-readable unique ids.