mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(all): buttons are type="button"
This commit is contained in:
@ -237,7 +237,7 @@ export class ActionSheet implements OverlayInterface {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{buttons.map(b =>
|
{buttons.map(b =>
|
||||||
<button class={buttonClass(b)} onClick={() => this.buttonClick(b)}>
|
<button type="button" class={buttonClass(b)} onClick={() => this.buttonClick(b)}>
|
||||||
<span class="action-sheet-button-inner">
|
<span class="action-sheet-button-inner">
|
||||||
{b.icon && <ion-icon icon={b.icon} lazy={false} class="action-sheet-icon" />}
|
{b.icon && <ion-icon icon={b.icon} lazy={false} class="action-sheet-icon" />}
|
||||||
{b.text}
|
{b.text}
|
||||||
@ -249,6 +249,7 @@ export class ActionSheet implements OverlayInterface {
|
|||||||
{cancelButton &&
|
{cancelButton &&
|
||||||
<div class="action-sheet-group action-sheet-group-cancel">
|
<div class="action-sheet-group action-sheet-group-cancel">
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
class={buttonClass(cancelButton)}
|
class={buttonClass(cancelButton)}
|
||||||
onClick={() => this.buttonClick(cancelButton)}
|
onClick={() => this.buttonClick(cancelButton)}
|
||||||
>
|
>
|
||||||
|
@ -315,6 +315,7 @@ export class Alert implements OverlayInterface {
|
|||||||
<div class="alert-checkbox-group" aria-labelledby={labelledby}>
|
<div class="alert-checkbox-group" aria-labelledby={labelledby}>
|
||||||
{ inputs.map(i => (
|
{ inputs.map(i => (
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
onClick={() => this.cbClick(i)}
|
onClick={() => this.cbClick(i)}
|
||||||
aria-checked={i.checked ? 'true' : null}
|
aria-checked={i.checked ? 'true' : null}
|
||||||
id={i.id}
|
id={i.id}
|
||||||
@ -345,6 +346,7 @@ export class Alert implements OverlayInterface {
|
|||||||
<div class="alert-radio-group" role="radiogroup" aria-labelledby={labelledby} aria-activedescendant={this.activeId}>
|
<div class="alert-radio-group" role="radiogroup" aria-labelledby={labelledby} aria-activedescendant={this.activeId}>
|
||||||
{ inputs.map(i => (
|
{ inputs.map(i => (
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
onClick={() => this.rbClick(i)}
|
onClick={() => this.rbClick(i)}
|
||||||
aria-checked={i.checked ? 'true' : null}
|
aria-checked={i.checked ? 'true' : null}
|
||||||
disabled={i.disabled}
|
disabled={i.disabled}
|
||||||
@ -413,7 +415,7 @@ export class Alert implements OverlayInterface {
|
|||||||
return (
|
return (
|
||||||
<div class={alertButtonGroupClass}>
|
<div class={alertButtonGroupClass}>
|
||||||
{buttons.map(button =>
|
{buttons.map(button =>
|
||||||
<button class={buttonClass(button)} tabIndex={0} onClick={() => this.buttonClick(button)}>
|
<button type="button" class={buttonClass(button)} tabIndex={0} onClick={() => this.buttonClick(button)}>
|
||||||
<span class="alert-button-inner">
|
<span class="alert-button-inner">
|
||||||
{button.text}
|
{button.text}
|
||||||
</span>
|
</span>
|
||||||
|
@ -77,6 +77,7 @@ export class BackButton {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
class="back-button-native"
|
class="back-button-native"
|
||||||
onClick={ev => this.onClick(ev)}>
|
onClick={ev => this.onClick(ev)}>
|
||||||
<span class="back-button-inner">
|
<span class="back-button-inner">
|
||||||
|
@ -49,7 +49,7 @@ export class MenuButton {
|
|||||||
const menuIcon = this.config.get('menuIcon', 'menu');
|
const menuIcon = this.config.get('menuIcon', 'menu');
|
||||||
return (
|
return (
|
||||||
<ion-menu-toggle menu={this.menu} autoHide={this.autoHide}>
|
<ion-menu-toggle menu={this.menu} autoHide={this.autoHide}>
|
||||||
<button>
|
<button type="button">
|
||||||
<slot>
|
<slot>
|
||||||
<ion-icon icon={menuIcon} mode={this.mode} color={this.color} lazy={false} />
|
<ion-icon icon={menuIcon} mode={this.mode} color={this.color} lazy={false} />
|
||||||
</slot>
|
</slot>
|
||||||
|
@ -330,6 +330,7 @@ export class PickerColumnCmp {
|
|||||||
ref={ el => this.optsEl = el }>
|
ref={ el => this.optsEl = el }>
|
||||||
{ col.options.map((o, index) =>
|
{ col.options.map((o, index) =>
|
||||||
<Button
|
<Button
|
||||||
|
type="button"
|
||||||
class={{ 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }}
|
class={{ 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }}
|
||||||
disable-activated
|
disable-activated
|
||||||
opt-index={index}>
|
opt-index={index}>
|
||||||
|
@ -283,6 +283,7 @@ export class Picker implements OverlayInterface {
|
|||||||
{buttons.map(b => (
|
{buttons.map(b => (
|
||||||
<div class={buttonWrapperClass(b)}>
|
<div class={buttonWrapperClass(b)}>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
onClick={() => this.buttonClick(b)}
|
onClick={() => this.buttonClick(b)}
|
||||||
class={buttonClass(b)}
|
class={buttonClass(b)}
|
||||||
>
|
>
|
||||||
|
@ -69,6 +69,7 @@ export class SegmentButton {
|
|||||||
render() {
|
render() {
|
||||||
return [
|
return [
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
aria-pressed={this.checked ? 'true' : null}
|
aria-pressed={this.checked ? 'true' : null}
|
||||||
class="segment-button-native"
|
class="segment-button-native"
|
||||||
disabled={this.disabled}
|
disabled={this.disabled}
|
||||||
|
Reference in New Issue
Block a user