Skip to content

Commit

Permalink
test remove stopPropagation
Browse files Browse the repository at this point in the history
Refs: #6725
  • Loading branch information
Makko74 committed Sep 3, 2024
1 parent 5c2e74c commit 6d915c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
28 changes: 16 additions & 12 deletions packages/components/src/components/button/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
import type { JSX } from '@stencil/core';
import { Component, Element, h, Host, Method, Prop, State, Watch } from '@stencil/core';

import { stopPropagation, tryToDispatchKoliBriEvent } from '../../utils/events';
import { /* stopPropagation, */ tryToDispatchKoliBriEvent } from '../../utils/events';
import { nonce } from '../../utils/dev.utils';
import { propagateResetEventToForm, propagateSubmitEventToForm } from '../form/controller';
import { AssociatedInputController } from '../input-adapter-leanup/associated.controller';
Expand Down Expand Up @@ -86,17 +86,21 @@ export class KolButtonWc implements ButtonAPI, FocusableElement {
});
} else {
// Event handling
stopPropagation(event);
tryToDispatchKoliBriEvent('click', this.host, this.state._value);

// TODO: Static form handling
this.controller.setFormAssociatedValue(this.state._value);

// Callback
if (typeof this.state._on?.onClick === 'function') {
setEventTarget(event, this.buttonRef);
this.state._on?.onClick(event, this.state._value);
}
// stopPropagation(event);

setTimeout(() => {
tryToDispatchKoliBriEvent('click', this.host, this.state._value);

// TODO: Static form handling
this.controller.setFormAssociatedValue(this.state._value);

// Callback
if (typeof this.state._on?.onClick === 'function') {
setEventTarget(event, this.buttonRef);
this.state._on?.onClick(event, this.state._value);
}
}, 10)

}
};

Expand Down
5 changes: 4 additions & 1 deletion packages/samples/react/src/components/split-button/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { ToasterService } from '@public-ui/components';
import { KolSplitButton } from '@public-ui/react';
import { KolButton, KolInputText, KolSplitButton } from '@public-ui/react';
import { SampleDescription } from '../SampleDescription';

import type { FC } from 'react';
Expand Down Expand Up @@ -32,6 +32,9 @@ export const SplitButtonBasic: FC = () => {
<KolSplitButton _label="Button without visible label" _hideLabel _icons="codicon codicon-git-pull-request">
Dropdown-Inhalt
</KolSplitButton>
<KolButton _label='Test'></KolButton>
<KolInputText _label='Irgendwas'></KolInputText>
<input />
</div>
</>
);
Expand Down

0 comments on commit 6d915c8

Please sign in to comment.