File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1212 const isTyping = document . activeElement . matches ( "input, textarea" ) ;
1313 if ( e . ctrlKey ) {
1414 if ( e . key == "Enter" && ! anyDialogOpen ) {
15- document . getElementById ( "submit-button" ) . click ( ) ;
15+ document . getElementById ( "submit-button" ) ? .click ( ) ;
1616 }
1717 if ( e . key == "," && ! anyDialogOpen ) {
1818 ui . view ( "settings" ) ;
3636 if ( e . key == "R" && ! anyDialogOpen && ! isTyping ) {
3737 themes . resetTheme ( ) ;
3838 }
39+ } else if ( e . key == "Enter" && anyDialogOpen ) {
40+ document . querySelector ( 'dialog[open] .submit-button' ) ?. click ( ) ;
3941 }
4042 } ) ;
4143} catch ( error ) {
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export function modal(options) {
7070 var btnElement = new Element ( "button" , button . text , {
7171 click : ( ) => {
7272 if ( button . onclick ) {
73- const inputValue = ( dialog . querySelectorAll ( ".dialog-input" ) . length > 0 ) ? [ ...dialog . querySelectorAll ( ".dialog-input" ) ] . map ( dialogInput => {
73+ const inputValue = ( dialog . querySelectorAll ( ".dialog-input" ) . length > 1 ) ? [ ...dialog . querySelectorAll ( ".dialog-input" ) ] . map ( dialogInput => {
7474 return dialogInput . value ;
7575 } ) : ( dialog . querySelector ( ".dialog-input" ) ? dialog . querySelector ( ".dialog-input" ) . value : null ) ;
7676 button . onclick ( inputValue ) ;
You can’t perform that action at this time.
0 commit comments