Skip to content

Commit

Permalink
fix(all): buttons are type="button"
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Aug 7, 2018
1 parent 4e56592 commit 2b7007f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/src/components/action-sheet/action-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class ActionSheet implements OverlayInterface {
</div>
}
{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">
{b.icon && <ion-icon icon={b.icon} lazy={false} class="action-sheet-icon" />}
{b.text}
Expand All @@ -249,6 +249,7 @@ export class ActionSheet implements OverlayInterface {
{cancelButton &&
<div class="action-sheet-group action-sheet-group-cancel">
<button
type="button"
class={buttonClass(cancelButton)}
onClick={() => this.buttonClick(cancelButton)}
>
Expand Down
4 changes: 3 additions & 1 deletion core/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export class Alert implements OverlayInterface {
<div class="alert-checkbox-group" aria-labelledby={labelledby}>
{ inputs.map(i => (
<button
type="button"
onClick={() => this.cbClick(i)}
aria-checked={i.checked ? 'true' : null}
id={i.id}
Expand Down Expand Up @@ -345,6 +346,7 @@ export class Alert implements OverlayInterface {
<div class="alert-radio-group" role="radiogroup" aria-labelledby={labelledby} aria-activedescendant={this.activeId}>
{ inputs.map(i => (
<button
type="button"
onClick={() => this.rbClick(i)}
aria-checked={i.checked ? 'true' : null}
disabled={i.disabled}
Expand Down Expand Up @@ -413,7 +415,7 @@ export class Alert implements OverlayInterface {
return (
<div class={alertButtonGroupClass}>
{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">
{button.text}
</span>
Expand Down
1 change: 1 addition & 0 deletions core/src/components/back-button/back-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class BackButton {

return (
<button
type="button"
class="back-button-native"
onClick={ev => this.onClick(ev)}>
<span class="back-button-inner">
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/menu-button/menu-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class MenuButton {
const menuIcon = this.config.get('menuIcon', 'menu');
return (
<ion-menu-toggle menu={this.menu} autoHide={this.autoHide}>
<button>
<button type="button">
<slot>
<ion-icon icon={menuIcon} mode={this.mode} color={this.color} lazy={false} />
</slot>
Expand Down
1 change: 1 addition & 0 deletions core/src/components/picker-column/picker-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ export class PickerColumnCmp {
ref={ el => this.optsEl = el }>
{ col.options.map((o, index) =>
<Button
type="button"
class={{ 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }}
disable-activated
opt-index={index}>
Expand Down
1 change: 1 addition & 0 deletions core/src/components/picker/picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export class Picker implements OverlayInterface {
{buttons.map(b => (
<div class={buttonWrapperClass(b)}>
<button
type="button"
onClick={() => this.buttonClick(b)}
class={buttonClass(b)}
>
Expand Down
1 change: 1 addition & 0 deletions core/src/components/segment-button/segment-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class SegmentButton {
render() {
return [
<button
type="button"
aria-pressed={this.checked ? 'true' : null}
class="segment-button-native"
disabled={this.disabled}
Expand Down

0 comments on commit 2b7007f

Please sign in to comment.