-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
No way to create tags on mobile #46
Comments
to create tags on mobileyou must add buttoncodesandboxexport default function App() {
const [selected, setSelected] = useState(["papaya"]);
const handleButtonClick = () => {
const InputElement = document.querySelector(`#id .rti--input`);
if (InputElement) {
const value = InputElement.value;
if (!selected.includes(value) && value !== "") {
setSelected([...selected, value]);
InputElement.value = "";
}
}
};
return (
<div>
<h1>Add Fruits</h1>
<pre>{JSON.stringify(selected)}</pre>
<div id={"id"}>
<TagsInput value={selected} onChange={setSelected} />
<button
type="button"
onClick={handleButtonClick}
className="px-6 py-2 text-white bg-primary rounded-md"
>
add tage
</button>
</div>
</div>
);
} |
seems you also can simply add same logic to onBlur handler:
in this case you must pass name to TagInput, but then you don't need extra div-wrapper around TagInput and can simplify selector to find element by name attribute. |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The component doesn't allow any way to create tags using a mobile browser. I tried adding different separators as well, still doesn't work.
Tested on Chrome.
The text was updated successfully, but these errors were encountered: