|
|
|
@ -330,7 +330,7 @@ export const AltTextModal = forwardRef<ModalRef, Props & Partial<RestoreProps>>(
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, [dispatch, setIsSaving, mediaId, onClose, position, description]);
|
|
|
|
}, [dispatch, setIsSaving, mediaId, onClose, position, description]);
|
|
|
|
|
|
|
|
|
|
|
|
const handleKeyUp = useCallback(
|
|
|
|
const handleKeyDown = useCallback(
|
|
|
|
(e: React.KeyboardEvent) => {
|
|
|
|
(e: React.KeyboardEvent) => {
|
|
|
|
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
|
|
|
|
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
@ -457,7 +457,7 @@ export const AltTextModal = forwardRef<ModalRef, Props & Partial<RestoreProps>>(
|
|
|
|
id='description'
|
|
|
|
id='description'
|
|
|
|
value={isDetecting ? ' ' : description}
|
|
|
|
value={isDetecting ? ' ' : description}
|
|
|
|
onChange={handleDescriptionChange}
|
|
|
|
onChange={handleDescriptionChange}
|
|
|
|
onKeyUp={handleKeyUp}
|
|
|
|
onKeyDown={handleKeyDown}
|
|
|
|
lang={lang}
|
|
|
|
lang={lang}
|
|
|
|
placeholder={intl.formatMessage(
|
|
|
|
placeholder={intl.formatMessage(
|
|
|
|
type === 'audio'
|
|
|
|
type === 'audio'
|
|
|
|
|