Skip to content

More menu "feature toggle" invalid HTML #13903

@afercia

Description

@afercia

Noticed while reviewing #13059

The FeatureToggle component renders a label HTML attribute, which is invalid HTML. Seems to me the label prop should only be used as children and not passed as a prop to MenuItem:

return (
<MenuItem
icon={ isActive && 'yes' }
isSelected={ isActive }
onClick={ flow( onToggle, speakMessage ) }
role="menuitemcheckbox"
label={ label }
info={ info }
>
{ label }
</MenuItem>

otherwise, it gets rendered as an HTML attribute (which doesn't do anything other than invalidating the HTML):

screenshot 2019-02-16 at 20 02 25

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Type] BugAn existing feature does not function as intended[Type] Code QualityIssues or PRs that relate to code quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions