Re-add auto slug population

pull/402/head
Bailey Pumfleet 2021-08-04 17:06:05 +01:00
parent a1720a05b4
commit 721b874bed
1 changed files with 7 additions and 0 deletions

View File

@ -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"