-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat(field): added character meter #2091
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one comment on your implementation, but before I go any further I'd like to ensure that this is the right general direction; are you sure we need to introduce field--grid
to get this working? We already have field--table
to handle a lot of the general layout, so this sort of feels redundant to me. Ian's original suggestion was to add a modifier or a wrapper around field__description
which allows for multiple cells, I'd like to know the reason why you didn't go with this path.
If you do decide to stick with field--grid
it looks like you also need to figure out a way to deal with long descriptions with text that needs to wrap, I don't believe that is currently accounted for.
<div id="field-character-meter-1-metergroup" class="field__character-meter"> | ||
<meter aria-label="Characters Remaining" class="field__character-meter_meter clipped" high="100" low="30" min="0" max="140" value="0"></meter> | ||
|
||
<div id="field-character-meter-1" class="field__character-meter_text"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is id="field-character-meter-1"
used at all for accessibility? I can see where the others are referenced, but not this one.
I originally, started implementing it using
I would really like to slowly move the
In essence, this approach follows Ian's suggestion of "expand on the current field__description to allow left and right portions." I did stray away from using the current classes to avoid potential style collisions and because a
I did make additional layout tweaks that now might allow for the use of I did verify that longer descriptions were working properly. If there is a specific issue you're seeing, please post a screenshot and let me know where. |
Actually I thought of the same thing as Luke, we don't really need the grid layout imo. Grid should be used when there are multiple columns/rows and different combinations of them. In this it seems like that is not the case, so flex should be fine to handle this. The first thing is we need to verify with design as well when we use the character count. My understanding is that it is primarily used with floating label or the label on top. From Figma I don't see any usecases with the label on the left (I believe that is a legacy usecase anyways) My understaind is that design is trying to phase out the label on the left, but we need to check. If it is being phased out, then it we can do it easy without grid since we can do a flex layout with a column direction. We should only support new layouts with the character count and not legacy ones imo. (This would be a good motivation to have teams to remove the old layouts as well) I think the approach is good and it works well. But if it can be simpler, I'm all for it as well. |
Closing PR. Will reopen if we need to add meter. |
Fixes #2047
Description
Field description (or error) and character meter was added as a grouped pair. Since positioning of one in this type of layout would impact the other, they needed to be within the same container. As such, minor markup modifications were needed to accomplish that. I don't think this is breaking since the new character meter feature can bear the responsibility of switching the layout to this new grid-based layout.
The docs also include the interactive portion of this effort that should serve as a model for how
ebay ui core
handles DOM updates. A debounced keystrokes approach was used limit DOM updates and screen reader read-outs.Notes
The resolution of this issue depends on the approval of an
a11y
review.Screenshots
Checklist