/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env browser */ "use strict";
// A list of menu items. // // This component provides keyboard navigation amongst any focusable // children.
class MenuList extends PureComponent { static get propTypes() { return { // ID to assign to the list container.
id: PropTypes.string,
// Children of the list.
children: PropTypes.any,
// Called whenever there is a change to the hovered or selected child. // The callback is passed the ID of the highlighted child or null if no // child is highlighted.
onHighlightedChildChange: PropTypes.func,
};
}
notifyHighlightedChildChange(id) { if (this.props.onHighlightedChildChange) { this.props.onHighlightedChildChange(id);
}
}
onKeyDown(e) { // Check if the focus is in the list. if (
!this.wrapperRef ||
!this.wrapperRef.contains(e.target.ownerDocument.activeElement)
) { return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.