Skip to content

Commit

Permalink
[v2] Allow propagation of keyup events on input elements (#5689)
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Dec 5, 2023
2 parents 1c2bcd2 + a4e141e commit c1efc5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export class InputController extends ControlledInputController implements Watche
const value = (event.target as HTMLInputElement).value;

// Event handling
stopPropagation(event);
tryToDispatchKoliBriEvent('change', this.host, value);

// Static form handling
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/tooltip/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class KolTooltip implements API {
if (this.previousSibling && this.tooltipElement /* SSR instanceof HTMLElement */) {
showOverlay(this.tooltipElement);
this.tooltipElement.style.setProperty('display', 'block');
getDocument().body.addEventListener('keyup', this.hideTooltipByEscape);
getDocument().addEventListener('keyup', this.hideTooltipByEscape);

const target = this.previousSibling;
const tooltipEl = this.tooltipElement;
Expand All @@ -59,11 +59,11 @@ export class KolTooltip implements API {
this.cleanupAutoPositioning = undefined;
}
}
getDocument().removeEventListener('keyup', this.hideTooltipByEscape);
};

private hideTooltipByEscape = (event: KeyboardEvent): void => {
if (event.key === 'Escape') {
getDocument().body.removeEventListener('keyup', this.hideTooltipByEscape);
this.hideTooltip();
}
};
Expand Down

0 comments on commit c1efc5c

Please sign in to comment.