Skip to content

Commit

Permalink
added linting and prettier fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ayaz Alavi <ayaz.alavi@gmail.com>
  • Loading branch information
ayazalavi committed Oct 9, 2023
1 parent 2cc1e12 commit a127491
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/libs/actions/InputFocus/index.desktop.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import Onyx from 'react-native-onyx';
import ONYXKEYS from '../../../ONYXKEYS';
import * as Browser from '../../Browser';
import ReportActionComposeFocusManager from '../../ReportActionComposeFocusManager';

function inputFocusChange(focus: boolean) {
Onyx.set(ONYXKEYS.INPUT_FOCUSED, focus);
}

let refSave: HTMLElement | undefined;
function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: { willAlertModalBecomeVisible: boolean; isVisible: boolean }, onyxFocused: boolean) {
function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: {willAlertModalBecomeVisible: boolean; isVisible: boolean}, onyxFocused: boolean) {
if (isFocused && !onyxFocused) {
inputFocusChange(true);
ref.focus();
}
}
if (isFocused) {
refSave = ref;
}
if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) {
if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) {
if (!ReportActionComposeFocusManager.isFocused()) {
refSave.focus();
} else {
} else {
refSave = undefined;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/libs/actions/InputFocus/index.website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ function inputFocusChange(focus: boolean) {
}

let refSave: HTMLElement | undefined;
function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: { willAlertModalBecomeVisible: boolean; isVisible: boolean }, onyxFocused: boolean) {
function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: {willAlertModalBecomeVisible: boolean; isVisible: boolean}, onyxFocused: boolean) {
if (Browser.isMobile()) {
return;
}
if (isFocused && !onyxFocused) {
inputFocusChange(true);
ref.focus();
}
}
if (isFocused) {
refSave = ref;
}
if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) {
if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) {
if (!ReportActionComposeFocusManager.isFocused()) {
refSave.focus();
} else {
} else {
refSave = undefined;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function ComposerWithSuggestions({
if (!suggestionsRef.current) {
return false;
}
InputFocus.inputFocusChange(false)
InputFocus.inputFocusChange(false);
return suggestionsRef.current.setShouldBlockSuggestionCalc(false);
}, [suggestionsRef]);

Expand Down

0 comments on commit a127491

Please sign in to comment.