fontIconPicker / react-fonticonpicker

React FontIconPicker Component to pick icon or SVG from a selection.
https://fonticonpicker.github.io/react-fonticonpicker/
MIT License
31 stars 33 forks source link

can not open dropdown with ref its automatic close #30

Open umairmanzoor1143 opened 1 year ago

umairmanzoor1143 commented 1 year ago

codeSandBox: https://codesandbox.io/s/icon-picker-cfldkf?file=/src/App.js code: `import FontIconPicker from "@fonticonpicker/react-fonticonpicker"; import "@fonticonpicker/react-fonticonpicker/dist/fonticonpicker.base-theme.react.css"; import "@fonticonpicker/react-fonticonpicker/dist/fonticonpicker.material-theme.react.css"; import React, { useRef, useState } from "react";

const IconPicker = () => { const [icon, setIcon] = useState(); const fontIconPickerRef = useRef(null); const handleChange = (i) => { setIcon(i); };

const handleCustomClick = () => { if (fontIconPickerRef.current) { fontIconPickerRef.current.handleDropDown(true); } }; console.log(fontIconPickerRef); return (

click
} theme="bluegrey" appendTo="body" renderUsing="class" iconsPerPage={20} value={icon} onChange={handleChange} isMulti={false} />

); };

export default IconPicker; `