Material-ui: Warning: Unknown event handler property `onKeyboardFocus`. He will be ignored

More detailed trace:

warning.js:33 Warning: Unknown event handler property `onKeyboardFocus`. It will be ignored.
    in div (created by IconMenu)
    in div (created by IconMenu)
    in IconMenu (created by DropdownMenu)
    in div (created by DropdownMenu)

I have an IconMenu with an IconButtonElement prop. For some reason, he continues to throw this warning. What for? What is it?

Example code that runs:

<IconMenu
    iconButtonElement={
        <div>
            <IconButton onClick={this.handleTouchTap}>
                <div >
                    <img src={require("../../settingsicon.svg")}/>
                </div>
            </IconButton>
        </div>}
    open={this.state.open}
    anchorOrigin={{horizontal: "right", vertical: "bottom"}}
    targetOrigin={{horizontal: "right", vertical: "top"}}
>
    <MenuItem
        className={someClass}
        onClick={this.handleLogOutClick}
    >
        <span className={someClass}Hello</span>
    </MenuItem>
    <Divider className={someClass}/>
    <MenuItem className={someClass}>
        <span className={someClass}>Goodbye</span>
    </MenuItem>
</IconMenu>

This is a fairly simple example, almost copied from the documentation with several functions into menu items, but nothing that should have caused such an error. Even when I made a complete example using barebone, it still throws a warning. It's a little ugly to have in the console every time a page loads :)

+4
source share
1 answer

IconMenu onKeyboardFocus prop , iconButtonElement, , React (, IconButton, docs), - , div onKeyboardFocus DOM- ( IconButton).

div iconButtonElement.

onKeyboardFocus no-op . IconMenu, , div iconButtonElement: itll , .

onKeyboardFocus, div , , , IconButton.

, ​​ :

+1

Source: https://habr.com/ru/post/1687868/


All Articles