[HOLD for payment 2022-07-15] [$250] Emoji Search Bar focus indicator is missing - reported by Santhoshkumar Sellavel
If you havenβt already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Open new Expensify in web/desktop
- Open any chat
- Click on the emoji icon in the composer
- Enter the search input
Expected Result:
Search input has a focus indicator, like other search inputs
Actual Result:
Search input has no focus indicator.
Workaround:
unknown
Platform:
Where is this issue occurring?
- Web
- Desktop App
Version Number: 1.1.76-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
https://user-images.githubusercontent.com/43995119/173277564-4481b44d-a694-4d6a-9c04-93a79d2531d6.mov
Issue reported by: @Santhosh-Sellavel Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1653082016688519
Triggered auto assignment to @MitchExpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Proposal
We can make a state isFocused and we can make it true at onFocus and false at onBlur
https://github.com/Expensify/App/blob/6bac9af7294877114f8bf9532ff7b8c46146c90d/src/components/EmojiPicker/EmojiPickerMenu/index.js#L437-L442 we need to use it like this:
onFocus={() => this.setState({isFocused: true})}
onBlur={() => this.setState({isFocused: false})}
now we have to use isFocused to change border color. We can do that by using the below line at composer
style={[styles.textInput, this.state.isFocused && styles.borderColorFocus]}
Proposal
we should use TextInput instead of Composer as Composer is intended to compose messages and should not be used in this place.
https://github.com/Expensify/App/blob/6bac9af7294877114f8bf9532ff7b8c46146c90d/src/components/EmojiPicker/EmojiPickerMenu/index.js#L437-L442
we should do
<TextInput
textAlignVertical="top"
placeholder={this.props.translate('common.search')}
placeholderTextColor={themeColors.textSupporting}
onChangeText={this.filterEmojis}
style={styles.textInput}
Doing this would solve the issue but will alter the height of the input field slightly, but it would be the same as all the other input fields so I think this would not be a problem but, it could be changed if necessary.
This would be consistent but I'm not sure it adds much value, do you think this change is worth it in the name of consistency @michelle-thompson ?
Hmm, not sure what would be best here so adding Engineering label here!
Hmm, not sure what would be best here so adding Engineering label here!
Triggered auto assignment to @TomatoToaster (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
I think it's worth fixing this - it's definitely a small visual change but it feels like it would look better. I'm not on the management team so I'll let an engineer from there review the proposals and confirm this is worth it.
Triggered auto assignment to @Christinadobrzyn (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Created job in Upwork
Internal - https://www.upwork.com/ab/applicants/1537544134022590464/job-details External - https://www.upwork.com/jobs/~01d76621dc2b371865
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (Exported)
Triggered auto assignment to @Luke9389 (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Open for new proposals.
@Santhosh-Sellavel Please share your reviews on this proposal.
Proposal
Problem
The Composer is not having the styles.borderColorFocus assigned to it.
Solution
- Add
highlightComposer: false,to the state to keep track of whether theComposeris focused or not. - Add
onFocusandonBlurevent handler to the composer to update thehighlightComposerstate variable. - Set the style on the
Composerbased on thehighlightComposerstate variable.
Code changes:
this.state = {
filteredEmojis: this.emojis,
headerIndices: this.unfilteredHeaderIndices,
highlightedIndex: -1,
arePointerEventsDisabled: false,
highlightComposer: false,
selection: {
start: 0,
end: 0,
},
};
<Composer
textAlignVertical="top"
placeholder={this.props.translate('common.search')}
placeholderTextColor={themeColors.textSupporting}
onChangeText={this.filterEmojis}
onFocus={() => this.setState({highlightComposer: true})}
onBlur={() => this.setState({highlightComposer: false})}
style={[styles.textInput, this.state.highlightComposer && styles.borderColorFocus]}
defaultValue=""
ref={el => this.searchInput = el}
autoFocus
selectTextOnFocus={this.state.selectTextOnFocus}
onSelectionChange={this.onSelectionChange}
/>
Screencast:
https://user-images.githubusercontent.com/911879/174441545-108720a9-b5cf-4866-a065-c9f85a9af0be.mp4
@Santhosh-Sellavel, can you review my proposal ?
@liyamahendra's proposal is just restating @Puneet-here's from above. Also @Santhosh-Sellavel can you give a written explanation (even just a short one) when you π proposals, please? Contributors need to know why their work is not accepted in order to improve.
On @Harshdeepjoshi proposal,
Doing this would solve the issue but will alter the height of the input field slightly.
Not on board with changing the component itself as it might cause unexpected regressions. So gave π
Sorry, somehow I missed @Puneet-here's comment! @liyamahendra's Proposal is the same as Puneet's.
So I like @Puneet-here Proposal here. Looks good to me! π π π C+ reviewed
cc: @Luke9389
OK cool, go ahead ands start a PR @Puneet-here!
Now that this is assigned I'm going to bump it down to weekly.