Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not open dropdown with ref its automatic close #30

Open
umairmanzoor1143 opened this issue Aug 23, 2023 · 0 comments
Open

can not open dropdown with ref its automatic close #30

umairmanzoor1143 opened this issue Aug 23, 2023 · 0 comments

Comments

@umairmanzoor1143
Copy link

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

<FontIconPicker
icons={[
"fipicon-angle-left",
"fipicon-angle-right",
"fipicon-angle-up",
"fipicon-angle-down"
]}
ref={fontIconPickerRef}
renderFunc={(svg) => }
theme="bluegrey"
appendTo="body"
renderUsing="class"
iconsPerPage={20}
value={icon}
onChange={handleChange}
isMulti={false}
/>

);
};

export default IconPicker;
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant