@@ -26,7 +26,7 @@ export interface PromptDialogOptions {
2626 readOnly ?: boolean ;
2727}
2828
29- export default function PromptDialog ( ) {
29+ export default function PromptDialog ( ) {
3030 const modalRef = useRef < HTMLDivElement > ( null ) ;
3131 const formRef = useRef < HTMLFormElement > ( null ) ;
3232 const labelRef = useRef < HTMLLabelElement > ( null ) ;
@@ -35,7 +35,7 @@ export default function PromptDialog() {
3535 const [ value , setValue ] = useState ( "" ) ;
3636 const [ shown , setShown ] = useState ( false ) ;
3737 const submitValue = useRef < string > ( null ) ;
38-
38+
3939 useTriliumEvent ( "showPromptDialog" , ( newOpts ) => {
4040 opts . current = newOpts ;
4141 setValue ( newOpts . defaultValue ?? "" ) ;
@@ -48,7 +48,7 @@ export default function PromptDialog() {
4848 title = { opts . current ?. title ?? t ( "prompt.title" ) }
4949 size = "lg"
5050 zIndex = { 2000 }
51- modalRef = { modalRef } formRef = { formRef }
51+ modalRef = { modalRef } formRef = { formRef }
5252 onShown = { ( ) => {
5353 opts . current ?. shown ?.( {
5454 $dialog : refToJQuerySelector ( modalRef ) ,
@@ -57,6 +57,7 @@ export default function PromptDialog() {
5757 $form : refToJQuerySelector ( formRef )
5858 } ) ;
5959 answerRef . current ?. focus ( ) ;
60+ answerRef . current ?. select ( ) ;
6061 } }
6162 onSubmit = { ( ) => {
6263 submitValue . current = value ;
0 commit comments