Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Prevent close on backdrop for alt text edit modal (#2492)

* fix: don't close on backdrop for alt text edit

* fix: ignore esc key press if a modal is open

authored by

Mary and committed by
GitHub
5b20ad1e 2f6c34d1

+8 -4
+3 -3
src/view/com/composer/Composer.tsx
··· 74 74 }: Props) { 75 75 const {currentAccount} = useSession() 76 76 const {data: currentProfile} = useProfileQuery({did: currentAccount!.did}) 77 - const {activeModals} = useModals() 77 + const {isModalActive, activeModals} = useModals() 78 78 const {openModal, closeModal} = useModalControls() 79 79 const {closeComposer} = useComposerControls() 80 80 const {track} = useAnalytics() ··· 176 176 [onPressCancel], 177 177 ) 178 178 useEffect(() => { 179 - if (isWeb) { 179 + if (isWeb && !isModalActive) { 180 180 window.addEventListener('keydown', onEscape) 181 181 return () => window.removeEventListener('keydown', onEscape) 182 182 } 183 - }, [onEscape]) 183 + }, [onEscape, isModalActive]) 184 184 185 185 const onPressAddLinkCard = useCallback( 186 186 (uri: string) => {
+5 -1
src/view/com/modals/Modal.web.tsx
··· 63 63 } 64 64 65 65 const onPressMask = () => { 66 - if (modal.name === 'crop-image' || modal.name === 'edit-image') { 66 + if ( 67 + modal.name === 'crop-image' || 68 + modal.name === 'edit-image' || 69 + modal.name === 'alt-text-image' 70 + ) { 67 71 return // dont close on mask presses during crop 68 72 } 69 73 closeModal()