@@ -18,7 +18,7 @@ export class DialogCont {
1818 }
1919}
2020
21- export function BaseDialog ( label , content , actionOK , actionCancel ) {
21+ export function BaseDialog ( label , content , actionOK , actionCancel , postRender = null ) {
2222 let dialog = new DialogCont ( ) ;
2323
2424 Component . config ( dialog . $root , {
@@ -71,19 +71,23 @@ export function BaseDialog(label, content, actionOK, actionCancel) {
7171 }
7272 }
7373 } ) ;
74+ if ( postRender ) postRender ( ) ;
7475}
7576
7677export function AsyncPrompt ( label , value ) {
7778 return new Promise ( resolve => {
7879 let area = Component . make ( 'textarea' , {
7980 text : value ,
81+ rows : 1 ,
8082 events : {
8183 input : ( ) => area . style . height = area . scrollHeight + "px" ,
8284 }
8385 } ) ;
84- area . style . height = area . scrollHeight + "px" ;
85- BaseDialog ( label , area , ( ) => resolve ( area . value ) , ( ) => resolve ( null ) ) ;
86- setTimeout ( ( ) => area . focus ( ) , 10 ) ;
86+
87+ BaseDialog ( label , area , ( ) => resolve ( area . value ) , ( ) => resolve ( null ) , ( ) => {
88+ area . focus ( ) ;
89+ area . style . height = area . scrollHeight + "px" ;
90+ } ) ;
8791 } ) ;
8892}
8993
0 commit comments