feat: add missing type="button" (#8030)

This commit is contained in:
Karthik Nishanth 2024-05-18 01:36:08 -07:00 committed by GitHub
parent 7d8b7fc14d
commit ff0b4394b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 20 additions and 2 deletions

View file

@ -468,6 +468,7 @@ export const ExitZenModeAction = ({
showExitZenModeBtn: boolean; showExitZenModeBtn: boolean;
}) => ( }) => (
<button <button
type="button"
className={clsx("disable-zen-mode", { className={clsx("disable-zen-mode", {
"disable-zen-mode--visible": showExitZenModeBtn, "disable-zen-mode--visible": showExitZenModeBtn,
})} })}

View file

@ -28,6 +28,7 @@ export const ButtonIconSelect = <T extends Object>(
{props.options.map((option) => {props.options.map((option) =>
props.type === "button" ? ( props.type === "button" ? (
<button <button
type="button"
key={option.text} key={option.text}
onClick={(event) => props.onClick(option.value, event)} onClick={(event) => props.onClick(option.value, event)}
className={clsx({ className={clsx({

View file

@ -22,7 +22,12 @@ export const CheckboxItem: React.FC<{
).focus(); ).focus();
}} }}
> >
<button className="Checkbox-box" role="checkbox" aria-checked={checked}> <button
type="button"
className="Checkbox-box"
role="checkbox"
aria-checked={checked}
>
{checkIcon} {checkIcon}
</button> </button>
<div className="Checkbox-label">{children}</div> <div className="Checkbox-label">{children}</div>

View file

@ -105,6 +105,7 @@ export const ContextMenu = React.memo(
}} }}
> >
<button <button
type="button"
className={clsx("context-menu-item", { className={clsx("context-menu-item", {
dangerous: actionName === "deleteSelectedElements", dangerous: actionName === "deleteSelectedElements",
checkmark: item.checked?.(appState), checkmark: item.checked?.(appState),

View file

@ -123,6 +123,7 @@ export const Dialog = (props: DialogProps) => {
onClick={onClose} onClick={onClose}
title={t("buttons.close")} title={t("buttons.close")}
aria-label={t("buttons.close")} aria-label={t("buttons.close")}
type="button"
> >
{CloseIcon} {CloseIcon}
</button> </button>

View file

@ -27,7 +27,11 @@ const FollowMode = ({
{userToFollow.username} {userToFollow.username}
</span> </span>
</div> </div>
<button onClick={onDisconnect} className="follow-mode__disconnect-btn"> <button
type="button"
onClick={onDisconnect}
className="follow-mode__disconnect-btn"
>
{CloseIcon} {CloseIcon}
</button> </button>
</div> </div>

View file

@ -108,6 +108,7 @@ function Picker<T>({
<div className="picker-content" ref={rGallery}> <div className="picker-content" ref={rGallery}>
{options.map((option, i) => ( {options.map((option, i) => (
<button <button
type="button"
className={clsx("picker-option", { className={clsx("picker-option", {
active: value === option.value, active: value === option.value,
})} })}
@ -171,6 +172,7 @@ export function IconPicker<T>({
<div> <div>
<button <button
name={group} name={group}
type="button"
className={isActive ? "active" : ""} className={isActive ? "active" : ""}
aria-label={label} aria-label={label}
onClick={() => setActive(!isActive)} onClick={() => setActive(!isActive)}

View file

@ -555,6 +555,7 @@ const LayerUI = ({
)} )}
{appState.scrolledOutside && ( {appState.scrolledOutside && (
<button <button
type="button"
className="scroll-back-to-content" className="scroll-back-to-content"
onClick={() => { onClick={() => {
setAppState((appState) => ({ setAppState((appState) => ({

View file

@ -194,6 +194,7 @@ export const MobileMenu = ({
!appState.openMenu && !appState.openMenu &&
!appState.openSidebar && ( !appState.openSidebar && (
<button <button
type="button"
className="scroll-back-to-content" className="scroll-back-to-content"
onClick={() => { onClick={() => {
setAppState((appState) => ({ setAppState((appState) => ({

View file

@ -65,6 +65,7 @@ const ChartPreviewBtn = (props: {
return ( return (
<button <button
type="button"
className="ChartPreview" className="ChartPreview"
onClick={() => { onClick={() => {
if (chartElements) { if (chartElements) {