Fix adding to group by username

This commit is contained in:
Fedor Indutny 2023-03-09 13:46:01 -08:00 committed by GitHub
parent e87062295e
commit 613d893f45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 26 deletions

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import React, { useCallback } from 'react';
import classNames from 'classnames';
import { getClassNamesFor } from '../util/getClassNamesFor';
@ -53,6 +53,13 @@ export function CircleCheckbox({
throw missingCaseError(variant);
}
const onChangeWrapped = useCallback(
(ev: React.ChangeEvent<HTMLInputElement>) => {
onChange?.(ev.target.checked);
},
[onChange]
);
return (
<div className={classNames(getClassName('__checkbox'), variantModifier)}>
<input
@ -61,7 +68,7 @@ export function CircleCheckbox({
aria-disabled={disabled}
id={id}
name={name}
onChange={onChange && (ev => onChange(ev.target.checked))}
onChange={onChangeWrapped}
onClick={onClick}
type={isRadio ? 'radio' : 'checkbox'}
/>