Skip to content

Commit 1138300

Browse files
authored
Merge pull request #4190 from aman-atg/aman-atg-fix-whitespace-issues
Fix: Using trim() for better UX
2 parents 5d1c9ff + 59280bb commit 1138300

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/pages/SearchPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class SearchPage extends Component {
128128
} = getSearchOptions(
129129
this.props.reports,
130130
this.props.personalDetails,
131-
this.state.searchValue,
131+
this.state.searchValue.trim(),
132132
this.props.betas,
133133
);
134134
this.setState({

src/pages/home/report/EmojiPickerMenu/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class EmojiPickerMenu extends Component {
274274
* @param {String} searchTerm
275275
*/
276276
filterEmojis(searchTerm) {
277-
const normalizedSearchTerm = searchTerm.toLowerCase();
277+
const normalizedSearchTerm = searchTerm.toLowerCase().trim();
278278
if (normalizedSearchTerm === '') {
279279
// There are no headers when searching, so we need to re-make them sticky when there is no search term
280280
this.setState({

src/pages/settings/Profile/ProfilePage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ class ProfilePage extends Component {
193193
&& this.props.myPersonalDetails.pronouns === this.state.selfSelectedPronouns);
194194

195195
// Disables button if none of the form values have changed
196-
const isButtonDisabled = (this.props.myPersonalDetails.firstName === this.state.firstName)
197-
&& (this.props.myPersonalDetails.lastName === this.state.lastName)
196+
const isButtonDisabled = (this.props.myPersonalDetails.firstName === this.state.firstName.trim())
197+
&& (this.props.myPersonalDetails.lastName === this.state.lastName.trim())
198198
&& (this.props.myPersonalDetails.timezone.selected === this.state.selectedTimezone)
199199
&& (this.props.myPersonalDetails.timezone.automatic === this.state.isAutomaticTimezone)
200200
&& arePronounsUnchanged;

0 commit comments

Comments
 (0)