diff --git a/core/src/components/button/button.tsx b/core/src/components/button/button.tsx index a936f54185..02e9ea0638 100644 --- a/core/src/components/button/button.tsx +++ b/core/src/components/button/button.tsx @@ -1,7 +1,8 @@ import { Component, Element, Event, EventEmitter, Prop, State } from '@stencil/core'; import { Color, CssClassMap, Mode, RouterDirection } from '../../interface'; -import { getParentNode, openURL } from '../../utils/theme'; +import { hasShadowDom } from '../../utils/helpers'; +import { openURL } from '../../utils/theme'; @Component({ tag: 'ion-button', @@ -121,28 +122,25 @@ export class Button { } onClick(ev: Event) { - if (this.type === 'submit') { + if (this.type === 'button') { + openURL(this.win, this.href, ev, this.routerDirection); + + } else if (hasShadowDom(this.el)) { // this button wants to specifically submit a form // climb up the dom to see if we're in a