v0.9.57 event title bug fix

This commit is contained in:
2026-03-17 17:05:43 -04:00
parent dc7be22ed2
commit 8bde33ffc5
5 changed files with 8 additions and 5 deletions

View File

@@ -169,6 +169,8 @@ function EventForm({ event, userGroups, eventTypes, selectedDate, onSave, onCanc
const [saving,setSaving]=useState(false);
const [showTypeForm,setShowTypeForm]=useState(false);
const [localTypes,setLocalTypes]=useState(eventTypes);
// Sync localTypes when parent provides updated eventTypes (e.g. after async load)
useEffect(()=>{ setLocalTypes(eventTypes); },[eventTypes]);
const typeRef=useRef(null);
// Track whether the user has manually changed the end time (vs auto-computed)
@@ -232,7 +234,7 @@ function EventForm({ event, userGroups, eventTypes, selectedDate, onSave, onCanc
return (
<div style={{width:'100%',maxWidth:1024,overflowX:'auto'}}>
<div style={{minWidth:500}}>
<div style={{minWidth:500}} onKeyDown={e=>{if(e.key==='Enter'&&e.target.tagName!=='TEXTAREA') e.preventDefault();}}>
{/* Title */}
<div style={{marginBottom:20}}>
<input className="input" placeholder="Add title" value={title} onChange={e=>setTitle(e.target.value)}
@@ -243,6 +245,7 @@ function EventForm({ event, userGroups, eventTypes, selectedDate, onSave, onCanc
<FormRow label="Event Type">
<div style={{display:'flex',gap:8,alignItems:'center',position:'relative'}} ref={typeRef}>
<select className="input" value={typeId} onChange={e=>setTypeId(e.target.value)} style={{flex:1}}>
<option value=""> Select type </option>
{localTypes.map(t=><option key={t.id} value={t.id}>{t.name}</option>)}
</select>
{isToolManager&&<button className="btn btn-secondary btn-sm" style={{flexShrink:0}} onClick={()=>setShowTypeForm(v=>!v)}>{showTypeForm?'Cancel':'+ Type'}</button>}