Skip to content
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

PostSchedule redundant label element #11747

Closed
afercia opened this issue Nov 12, 2018 · 0 comments · Fixed by #15381
Closed

PostSchedule redundant label element #11747

afercia opened this issue Nov 12, 2018 · 0 comments · Fixed by #15381
Labels
[Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality

Comments

@afercia
Copy link
Contributor

afercia commented Nov 12, 2018

The PostSchedule component (Status & Visibility > Publish) currently renders 2 <label> elements associated to the same control:

<label
htmlFor={ `edit-post-post-schedule__toggle-${ instanceId }` }
id={ `edit-post-post-schedule__heading-${ instanceId }` }
>
{ __( 'Publish' ) }
</label>
<Dropdown
position="bottom left"
contentClassName="edit-post-post-schedule__dialog"
renderToggle={ ( { onToggle, isOpen } ) => (
<Fragment>
<label
className="edit-post-post-schedule__label"
htmlFor={ `edit-post-post-schedule__toggle-${ instanceId }` }
>
<PostScheduleLabel /> { __( 'Click to change' ) }
</label>
<Button
id={ `edit-post-post-schedule__toggle-${ instanceId }` }
type="button"
className="edit-post-post-schedule__toggle"
onClick={ onToggle }
aria-expanded={ isOpen }
aria-live="polite"
isLink
>
<PostScheduleLabel />
</Button>

Technically, multiple labels are allowed but I'm not sure what is the purpose of the second label, as it's always hidden with display: none. Removing the display: none for testing purposes, reveals this:

screenshot 2018-11-12 at 08 45 10

which repeats the scheduled date with a text "Click to change" that seems unnecessary to me and it's not perceived by anyone anyways:

.edit-post-post-schedule__label {
display: none;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant