diff --git a/frontend/src/Editor/LeftSidebar/SidebarPageSelector/EditInput.jsx b/frontend/src/Editor/LeftSidebar/SidebarPageSelector/EditInput.jsx index f7c5f79df2..2c0156c337 100644 --- a/frontend/src/Editor/LeftSidebar/SidebarPageSelector/EditInput.jsx +++ b/frontend/src/Editor/LeftSidebar/SidebarPageSelector/EditInput.jsx @@ -1,5 +1,6 @@ import React, { useState } from 'react'; import { ToolTip } from '@/Editor/Inspector/Elements/Components/ToolTip'; +import { validateKebabCase } from '@/_helpers/utils'; export const EditInput = ({ slug, error, setError, pageHandle, setPageHandle, isSaving = false }) => { const [value, set] = useState(pageHandle); @@ -10,7 +11,10 @@ export const EditInput = ({ slug, error, setError, pageHandle, setPageHandle, is if (newHandle === '') setError('Page handle cannot be empty'); if (newHandle === value) setError('Page handle cannot be same as the existing page handle'); - + const isValidKebabCase = validateKebabCase(newHandle); + if (!isValidKebabCase.isValid) { + setError(isValidKebabCase.error); + } set(newHandle); };