Skip to content

Commit

Permalink
fix(homebrew): Fixed homebrew autocompletes not clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbenton committed Apr 12, 2024
1 parent 87606ae commit 1fd0c73
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function MoveCategoryDialogForm(props: MoveCategoryFormDialogProps) {
}}
/>
<Controller
name='description'
name="description"
control={control}
render={({ field }) => (
<MarkdownEditor
Expand All @@ -162,7 +162,7 @@ export function MoveCategoryDialogForm(props: MoveCategoryFormDialogProps) {
<MoveCategoryAutocomplete
label={"Replaces Category"}
value={field.value}
onChange={(ids) => field.onChange(ids)}
onChange={(ids) => field.onChange(ids ?? null)}
onBlur={field.onBlur}
helperText={
"Replaces the category (and all moves within) with this category"
Expand All @@ -177,7 +177,7 @@ export function MoveCategoryDialogForm(props: MoveCategoryFormDialogProps) {
<MoveCategoryAutocomplete
label={"Enhances Category"}
value={field.value}
onChange={(ids) => field.onChange(ids)}
onChange={(ids) => field.onChange(ids ?? null)}
onBlur={field.onBlur}
helperText={
"Adds moves in this category to the entered category"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function MoveDialogForm(props: MoveFormDialogProps) {
}}
/>
<Controller
name='text'
name="text"
control={control}
render={({ field }) => (
<MarkdownEditor
Expand All @@ -224,7 +224,7 @@ export function MoveDialogForm(props: MoveFormDialogProps) {
<MoveAutocomplete
label={"Replaces Move"}
value={field.value}
onChange={(ids) => field.onChange(ids)}
onChange={(ids) => field.onChange(ids ?? null)}
onBlur={field.onBlur}
disabled={disabled}
helperText={"Replaces an existing move with this one."}
Expand Down Expand Up @@ -292,7 +292,7 @@ export function MoveDialogForm(props: MoveFormDialogProps) {
<LegacyTrackAutocomplete
multiple
value={field.value}
onChange={(ids) => field.onChange(ids)}
onChange={(ids) => field.onChange(ids ?? [])}
onBlur={field.onBlur}
disabled={disabled}
helperText={"Legacy Tracks you would like to roll against"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function OracleTableRollableAutocomplete(
)}
value={value ?? null}
onChange={(evt, value) => {
console.debug(value);
onChange(value ?? undefined);
}}
onBlur={onBlur}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function OracleTablesCollectionDialogForm(
}}
/>
<Controller
name='description'
name="description"
control={control}
render={({ field }) => (
<MarkdownEditor
Expand All @@ -179,7 +179,7 @@ export function OracleTablesCollectionDialogForm(
<OracleCollectionAutocomplete
label={"Replaces Collection"}
value={field.value}
onChange={(ids) => field.onChange(ids)}
onChange={(ids) => field.onChange(ids ?? null)}
onBlur={field.onBlur}
helperText={
"Replaces all oracles within the given collection"
Expand All @@ -194,7 +194,7 @@ export function OracleTablesCollectionDialogForm(
<OracleCollectionAutocomplete
label={"Enhances Collection"}
value={field.value}
onChange={(ids) => field.onChange(ids)}
onChange={(ids) => field.onChange(ids ?? null)}
onBlur={field.onBlur}
helperText={
"Adds oracles in this collection to the entered collection"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export function OracleTableSimpleForm(props: OracleTableSimpleFormProps) {
}}
/>
<Controller
name='description'
name="description"
control={control}
render={({ field }) => (
<MarkdownEditor
Expand All @@ -178,7 +178,7 @@ export function OracleTableSimpleForm(props: OracleTableSimpleFormProps) {
<OracleTableRollableAutocomplete
label={"Replaces Table"}
value={field.value}
onChange={(ids) => field.onChange(ids)}
onChange={(ids) => field.onChange(ids ?? null)}
onBlur={field.onBlur}
helperText={"Replaces an existing oracle table with this one"}
/>
Expand All @@ -191,7 +191,7 @@ export function OracleTableSimpleForm(props: OracleTableSimpleFormProps) {
disabled={disabled}
control={
<Controller
name='showDetails'
name="showDetails"
control={control}
defaultValue={false}
render={({ field }) => (
Expand Down

0 comments on commit 1fd0c73

Please sign in to comment.