feat(admin): extend wysiwyg live editor
All checks were successful
Staging Build / build (push) Successful in 2m46s
All checks were successful
Staging Build / build (push) Successful in 2m46s
- Add is_required and allow_multiselect category toggles - Implement module-popover for product module assignment - Add cascade-protected deletion for categories and products - Add sidebar link with AdminNavLink active states
This commit is contained in:
@@ -26,8 +26,26 @@ export function InlineInput({ value, onSave, className, type = 'text' }: InlineI
|
||||
|
||||
const handleBlur = async () => {
|
||||
setIsEditing(false)
|
||||
if (currentValue !== value) {
|
||||
await onSave(currentValue)
|
||||
const trimmed = currentValue.trim()
|
||||
|
||||
if (type === 'number') {
|
||||
const parsed = parseFloat(trimmed)
|
||||
if (isNaN(parsed) || trimmed === '') {
|
||||
setCurrentValue(value)
|
||||
return
|
||||
}
|
||||
const finalVal = parsed.toString()
|
||||
if (finalVal !== value) {
|
||||
await onSave(finalVal)
|
||||
}
|
||||
} else {
|
||||
if (trimmed === '') {
|
||||
setCurrentValue(value)
|
||||
return
|
||||
}
|
||||
if (trimmed !== value) {
|
||||
await onSave(trimmed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user