Merge pull request #313 from ing-bank/fix/buttonGuard
[button] Guard against _nativeButton not defined
This commit is contained in:
commit
19000fff56
1 changed files with 1 additions and 1 deletions
|
|
@ -175,7 +175,7 @@ export class LionButton extends DisabledWithTabIndexMixin(SlotMixin(LitElement))
|
||||||
* Dispatch submit event and invoke submit on the native form when clicked
|
* Dispatch submit event and invoke submit on the native form when clicked
|
||||||
*/
|
*/
|
||||||
__clickDelegationHandler() {
|
__clickDelegationHandler() {
|
||||||
if (this.type === 'submit' && this._nativeButtonNode.form) {
|
if (this.type === 'submit' && this._nativeButtonNode && this._nativeButtonNode.form) {
|
||||||
this._nativeButtonNode.form.dispatchEvent(new Event('submit'));
|
this._nativeButtonNode.form.dispatchEvent(new Event('submit'));
|
||||||
this._nativeButtonNode.form.submit();
|
this._nativeButtonNode.form.submit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue