web.lib.core.components.hover-controlled-dropdown.tsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of code-quarkus Show documentation
Show all versions of code-quarkus Show documentation
Customize a Web Interface to generate Quarkus starter projects.
import * as React from 'react';
import { Dropdown } from 'react-bootstrap';
export function HoverControlledDropdown(props: any) {
const [ isHovered, setIsHovered ] = React.useState(false);
const { onMouseEnter, onMouseLeave, onToggle, ...rest } = props;
function onMouseEnterFn(e) {
if (onMouseEnter) {
onMouseEnter(e);
}
onToggleFn(true);
setIsHovered(true);
}
function onMouseLeaveFn(e) {
if (onMouseLeave) {
onMouseLeave(e);
}
onToggleFn(false);
setIsHovered(false);
}
function onToggleFn(isOpen: boolean) {
if (onToggle) {
onToggle(isOpen);
}
}
return (
);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy