Skip to content

Commit

Permalink
chore: remove ontouchstart event from buttons (#3746)
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk authored Jan 28, 2025
1 parent 3b3851c commit 171b8ae
Show file tree
Hide file tree
Showing 45 changed files with 64 additions and 54 deletions.
23 changes: 23 additions & 0 deletions .changeset/old-news-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-ui': patch
'@reown/appkit-adapter-bitcoin': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-core': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

Remove ontouchstart events from buttons
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class W3mAllWalletsListItem extends LitElement {
const certified = this.wallet?.badge_type === 'certified'

return html`
<button ontouchstart>
<button>
${this.imageTemplate()}
<wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="3xs">
<wui-text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class W3mOnRampProviderItem extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} ontouchstart>
<button ?disabled=${this.disabled}>
<wui-visual name=${ifDefined(this.name)} class="provider-image"></wui-visual>
<wui-flex flexDirection="column" gap="4xs">
<wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text>
Expand Down
7 changes: 1 addition & 6 deletions packages/ui-new/src/composites/wui-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ export class WuiButton extends LitElement {
const textVariant = this.textVariant ?? TEXT_VARIANT_BY_SIZE[this.size]

return html`
<button
data-variant=${this.variant}
data-size=${this.size}
?disabled=${this.disabled}
ontouchstart
>
<button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}>
${this.loadingTemplate()}
<slot name="iconLeft"></slot>
<wui-text variant=${textVariant} color="inherit">
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-card-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class WuiCardSelect extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button data-selected=${ifDefined(this.selected)} ?disabled=${this.disabled} ontouchstart>
<button data-selected=${ifDefined(this.selected)} ?disabled=${this.disabled}>
${this.imageTemplate()}
<wui-text variant="tiny-500" color=${this.selected ? 'accent-100' : 'inherit'}>
${this.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class WuiCompatibleNetwork extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ontouchstart>
<button>
<wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
<wui-flex gap="3xs" alignItems="center">
${this.networksTemplate()}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-connect-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class WuiConnectButton extends LitElement {
const textVariant = this.size === 'md' ? 'paragraph-600' : 'small-600'

return html`
<button data-size=${this.size} ?disabled=${this.loading} ontouchstart>
<button data-size=${this.size} ?disabled=${this.loading}>
${this.loadingTemplate()}
<wui-text variant=${textVariant} color=${this.loading ? 'accent-100' : 'inherit'}>
<slot></slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-icon-link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class WuiIconLink extends LitElement {
`

return html`
<button ?disabled=${this.disabled} ontouchstart>
<button ?disabled=${this.disabled}>
<wui-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wui-icon>
</button>
`
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class WuiLink extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} data-variant=${this.variant} ontouchstart>
<button ?disabled=${this.disabled} data-variant=${this.variant}>
<wui-text
color=${TEXT_COLOR_BY_VARIANT[this.variant]}
variant=${TEXT_VARIANT_BY_SIZE[this.size]}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-list-accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class WuiListAccordion extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ontouchstart @click=${() => this.onClick()}>
<button @click=${() => this.onClick()}>
<wui-flex justifyContent="space-between" alignItems="center">
<wui-text variant="paragraph-500" color="fg-100">${this.textTitle}</wui-text>
${this.chevronTemplate()}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-list-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class WuiListButton extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<wui-text align="center" variant="paragraph-500" color="inherit">${this.text}</wui-text>
</button>
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class WuiListDescription extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ontouchstart ?disabled=${this.disabled}>
<button ?disabled=${this.disabled}>
<wui-icon-box
iconColor=${this.iconColor}
backgroundColor=${this.iconBackgroundColor}
Expand Down
1 change: 0 additions & 1 deletion packages/ui-new/src/composites/wui-list-item/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class WuiListItem extends LitElement {
data-loading=${this.loading}
data-iconvariant=${ifDefined(this.iconVariant)}
tabindex=${ifDefined(this.tabIdx)}
ontouchstart
>
${this.loadingTemplate()} ${this.visualTemplate()}
<wui-flex gap="3xs">
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-list-network/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class WuiListNetwork extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button data-transparent=${this.transparent} ?disabled=${this.disabled} ontouchstart>
<button data-transparent=${this.transparent} ?disabled=${this.disabled}>
<wui-flex gap="s" alignItems="center">
${this.templateNetworkImage()}
<wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text></wui-flex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class WuiListSelectAccount extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} ontouchstart>
<button ?disabled=${this.disabled}>
<wui-avatar size="sm" address=${this.address}></wui-avatar>
<wui-icon class="avatarIcon" size="xs" name=${this.icon}></wui-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class WuiListSelectWallet extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} ontouchstart>
<button ?disabled=${this.disabled}>
${this.leftImageTemplate()}
<wui-text color="primary" variant="lg-regular" lineClamp="1">${this.name}</wui-text>
<wui-tag variant=${this.allWallets ? 'info' : 'accent'} size="sm">${this.tagLabel}</wui-tag>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-list-social/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class WuiListSocial extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<wui-logo logo=${this.logo}></wui-logo>
<wui-text
data-align=${this.align}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-list-token/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class WuiListToken extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button data-clickable=${String(this.clickable)} ontouchstart>
<button data-clickable=${String(this.clickable)}>
<wui-flex gap="s" alignItems="center">
${this.visualTemplate()}
<wui-flex flexDirection="column" justifyContent="spaceBetween">
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-logo-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class WuiLogoSelect extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<wui-logo logo=${this.logo}></wui-logo>
</button>
`
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-network-switch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class WuiNetworkSwitch extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} ontouchstart>
<button ?disabled=${this.disabled}>
${this.leftIconTemplate()}
<wui-text color="primary" variant=${TEXT_VARIANT_BY_SIZE[this.size]}>
<slot></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class WuiProfileButtonV2 extends LitElement {
const connectorId = StorageUtil.getConnectedConnectorId(namespace)
const shouldShowIcon = connectorId === ConstantsUtil.CONNECTOR_ID.AUTH

return html`<button ontouchstart data-testid="wui-profile-button" @click=${this.handleClick}>
return html`<button data-testid="wui-profile-button" @click=${this.handleClick}>
<wui-flex gap="xs" alignItems="center">
<wui-avatar
.imageSrc=${this.avatarSrc}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-profile-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class WuiProfileButton extends LitElement {

// -- Render -------------------------------------------- //
public override render() {
return html`<button ontouchstart data-testid="wui-profile-button">
return html`<button data-testid="wui-profile-button">
<wui-flex gap="xs" alignItems="center">
<wui-avatar
.imageSrc=${this.avatarSrc}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-promo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class WuiPromo extends LitElement {

// -- Render -------------------------------------------- //
public override render() {
return html`<button ontouchstart>
return html`<button>
<wui-text variant="small-600" color="bg-100">${this.text}</wui-text>
<wui-icon color="bg-100" size="xs" name="arrowRight"></wui-icon>
</button>`
Expand Down
7 changes: 1 addition & 6 deletions packages/ui-new/src/composites/wui-shortcut/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ export class WuiShortcut extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button
data-variant=${this.variant}
data-size=${this.size}
?disabled=${this.disabled}
ontouchstart
>
<button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}>
<wui-icon
color=${ifDefined(this.iconColor)}
size=${this.iconSize}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-new/src/composites/wui-token-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class WuiTokenButton extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ontouchstart>
<button>
${this.tokenTemplate()}
<wui-text variant="paragraph-600" color="fg-100">${this.text}</wui-text>
</button>
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/composites/wui-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export class WuiButton extends LitElement {
data-icon-right=${this.hasIconRight}
data-size=${this.size}
?disabled=${this.disabled}
ontouchstart
>
${this.loadingTemplate()}
<slot name="iconLeft" @slotchange=${() => this.handleSlotLeftChange()}></slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-card-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class WuiCardSelect extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button data-selected=${ifDefined(this.selected)} ?disabled=${this.disabled} ontouchstart>
<button data-selected=${ifDefined(this.selected)} ?disabled=${this.disabled}>
${this.imageTemplate()}
<wui-text variant="tiny-500" color=${this.selected ? 'accent-100' : 'inherit'}>
${this.name}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-compatible-network/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class WuiCompatibleNetwork extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ontouchstart>
<button>
<wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
<wui-flex gap="3xs" alignItems="center">
${this.networksTemplate()}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-connect-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class WuiConnectButton extends LitElement {
const textVariant = this.size === 'md' ? 'paragraph-600' : 'small-600'

return html`
<button data-size=${this.size} ?disabled=${this.loading} ontouchstart>
<button data-size=${this.size} ?disabled=${this.loading}>
${this.loadingTemplate()}
<wui-text variant=${textVariant} color=${this.loading ? 'accent-100' : 'inherit'}>
<slot></slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-icon-link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class WuiIconLink extends LitElement {
`

return html`
<button ?disabled=${this.disabled} ontouchstart>
<button ?disabled=${this.disabled}>
<wui-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wui-icon>
</button>
`
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class WuiLink extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<slot name="iconLeft"></slot>
<wui-text variant="small-600" color=${this.color}>
<slot></slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-list-accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class WuiListAccordion extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ontouchstart @click=${() => this.onClick()}>
<button @click=${() => this.onClick()}>
<wui-flex justifyContent="space-between" alignItems="center">
<wui-text variant="paragraph-500" color="fg-100">${this.textTitle}</wui-text>
${this.chevronTemplate()}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-list-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class WuiListButton extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<wui-text align="center" variant="paragraph-500" color="inherit">${this.text}</wui-text>
</button>
`
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-list-description/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class WuiListDescription extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ontouchstart ?disabled=${this.disabled}>
<button ?disabled=${this.disabled}>
<wui-icon-box
iconColor=${this.iconColor}
backgroundColor=${this.iconBackgroundColor}
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/composites/wui-list-item/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class WuiListItem extends LitElement {
data-loading=${this.loading}
data-iconvariant=${ifDefined(this.iconVariant)}
tabindex=${ifDefined(this.tabIdx)}
ontouchstart
>
${this.loadingTemplate()} ${this.visualTemplate()}
<wui-flex gap="3xs">
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-list-network/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class WuiListNetwork extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button data-transparent=${this.transparent} ?disabled=${this.disabled} ontouchstart>
<button data-transparent=${this.transparent} ?disabled=${this.disabled}>
<wui-flex gap="s" alignItems="center">
${this.templateNetworkImage()}
<wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text></wui-flex
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-list-social/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class WuiListSocial extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<wui-logo logo=${this.logo}></wui-logo>
<wui-text
data-align=${this.align}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-list-token/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class WuiListToken extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button data-clickable=${String(this.clickable)} ontouchstart>
<button data-clickable=${String(this.clickable)}>
<wui-flex gap="s" alignItems="center">
${this.visualTemplate()}
<wui-flex flexDirection="column" justifyContent="spaceBetween">
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-list-wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class WuiListWallet extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
${this.templateAllWallets()} ${this.templateWalletImage()}
<wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text>
${this.templateStatus()}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-logo-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class WuiLogoSelect extends LitElement {
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)} ontouchstart>
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<wui-logo logo=${this.logo}></wui-logo>
</button>
`
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-profile-button-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class WuiProfileButtonV2 extends LitElement {
const connectorId = StorageUtil.getConnectedConnectorId(namespace)
const shouldShowIcon = connectorId === ConstantsUtil.CONNECTOR_ID.AUTH

return html`<button ontouchstart data-testid="wui-profile-button" @click=${this.handleClick}>
return html`<button data-testid="wui-profile-button" @click=${this.handleClick}>
<wui-flex gap="xs" alignItems="center">
<wui-avatar
.imageSrc=${this.avatarSrc}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composites/wui-profile-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class WuiProfileButton extends LitElement {

// -- Render -------------------------------------------- //
public override render() {
return html`<button ontouchstart data-testid="wui-profile-button">
return html`<button data-testid="wui-profile-button">
<wui-flex gap="xs" alignItems="center">
<wui-avatar
.imageSrc=${this.avatarSrc}
Expand Down
Loading

0 comments on commit 171b8ae

Please sign in to comment.