All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.lib.core.components.hover-controlled-dropdown.tsx Maven / Gradle / Ivy

There is a newer version: 37
Show newest version
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