MCPcopy Create free account
hub / github.com/UI5/webcomponents / _onclick

Method _onclick

packages/main/src/Button.ts:512–555  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

510 }
511
512 _onclick(e: MouseEvent) {
513 e.stopImmediatePropagation();
514
515 if (this.nonInteractive) {
516 return;
517 }
518
519 if (this.loading) {
520 e.preventDefault();
521 return;
522 }
523
524 const {
525 altKey,
526 ctrlKey,
527 metaKey,
528 shiftKey,
529 } = e;
530
531 const prevented = !this.fireDecoratorEvent("click", {
532 originalEvent: e,
533 altKey,
534 ctrlKey,
535 metaKey,
536 shiftKey,
537 });
538
539 if (prevented) {
540 e.preventDefault();
541 return;
542 }
543
544 if (this._isSubmit) {
545 submitForm(this);
546 }
547
548 if (this._isReset) {
549 resetForm(this);
550 }
551
552 if (isSafari()) {
553 this.getDomRef()?.focus();
554 }
555 }
556
557 _onmousedown() {
558 if (this.nonInteractive) {

Callers 1

constructorMethod · 0.95

Calls 4

submitFormFunction · 0.85
resetFormFunction · 0.85
isSafariFunction · 0.85
focusMethod · 0.45

Tested by

no test coverage detected