Skip to content

Commit 94ae845

Browse files
authored
[ZEPPELIN-6185] fix prevent shortcut working in input field
### What is this PR for? This PR fixes an issue that prevents entering shortcut characters in input fields. When using a dynamic input field, characters like 'l', 'b', etc., are treated as shortcuts and cannot be entered. This fix prevents shortcut actions from being triggered when the focused element is an input field. ### What type of PR is it? Bug Fix ### Todos ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-6185 ### How should this be tested? * Create new notebook using dynamic input field * Enter 'l' character and see if it is not working as shortcut(toggling line numbers) ### Screenshots (if appropriate) ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Closes #4925 from sh1nj1/fix/shortcut-in-text-field. Signed-off-by: Philipp Dallig <[email protected]>
1 parent 1221444 commit 94ae845

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,13 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
466466
}>(...observables)
467467
.pipe(takeUntil(this.destroy$))
468468
.subscribe(({ action, event }) => {
469+
const target = event.target as HTMLElement;
470+
471+
// Skip handling shortcut if focused element is an input (by Dynamic form)
472+
if (target.tagName === 'INPUT') {
473+
return; // ignore shortcut to make input work
474+
}
475+
469476
if (this.mode === 'command') {
470477
switch (action) {
471478
case ParagraphActions.InsertAbove:

0 commit comments

Comments
 (0)