Re-add auto slug population
parent
a1720a05b4
commit
721b874bed
|
@ -56,6 +56,12 @@ export default function Availability({ user, types }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function autoPopulateSlug() {
|
||||||
|
let t = titleRef.current.value;
|
||||||
|
t = t.replace(/\s+/g, "-").toLowerCase();
|
||||||
|
slugRef.current.value = t;
|
||||||
|
}
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <Loader />;
|
return <Loader />;
|
||||||
}
|
}
|
||||||
|
@ -83,6 +89,7 @@ export default function Availability({ user, types }) {
|
||||||
</label>
|
</label>
|
||||||
<div className="mt-1">
|
<div className="mt-1">
|
||||||
<input
|
<input
|
||||||
|
onChange={autoPopulateSlug}
|
||||||
ref={titleRef}
|
ref={titleRef}
|
||||||
type="text"
|
type="text"
|
||||||
name="title"
|
name="title"
|
||||||
|
|
Loading…
Reference in New Issue