Skip to content

Commit 2ea98d6

Browse files
committed
fix(polls): add type=button to Chip selectors in PollCreatorDialog to prevent form submission
1 parent 192436f commit 2ea98d6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/app/features/room/poll/PollCreatorDialog.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export function PollCreatorDialog({ onCancel, onSubmit }: PollCreatorDialogProps
246246
</Text>
247247
<div className={css.KindSelector}>
248248
<Chip
249+
type="button"
249250
variant={
250251
kind ===
251252
(M_POLL_KIND_DISCLOSED.altName ?? 'org.matrix.msc3381.poll.disclosed')
@@ -267,6 +268,7 @@ export function PollCreatorDialog({ onCancel, onSubmit }: PollCreatorDialogProps
267268
<Text size="B300">Show live results</Text>
268269
</Chip>
269270
<Chip
271+
type="button"
270272
variant={
271273
kind ===
272274
(M_POLL_KIND_UNDISCLOSED.altName ?? 'org.matrix.msc3381.poll.undisclosed')
@@ -297,6 +299,7 @@ export function PollCreatorDialog({ onCancel, onSubmit }: PollCreatorDialogProps
297299
</Text>
298300
<div className={css.KindSelector}>
299301
<Chip
302+
type="button"
300303
variant={showVoterNames ? 'Primary' : 'SurfaceVariant'}
301304
size="400"
302305
radii="300"
@@ -306,6 +309,7 @@ export function PollCreatorDialog({ onCancel, onSubmit }: PollCreatorDialogProps
306309
<Text size="B300">Show voters</Text>
307310
</Chip>
308311
<Chip
312+
type="button"
309313
variant={!showVoterNames ? 'Primary' : 'SurfaceVariant'}
310314
size="400"
311315
radii="300"
@@ -326,6 +330,7 @@ export function PollCreatorDialog({ onCancel, onSubmit }: PollCreatorDialogProps
326330
{EXPIRY_PRESETS.map((p) => (
327331
<Chip
328332
key={p.value}
333+
type="button"
329334
variant={expiryPreset === p.value ? 'Primary' : 'SurfaceVariant'}
330335
size="400"
331336
radii="300"

0 commit comments

Comments
 (0)