Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vertical spacing to avoid outline getting cut off in Address Search input #17403

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/components/AddressSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import TextInput from './TextInput';
import * as ApiUtils from '../libs/ApiUtils';
import * as GooglePlacesUtils from '../libs/GooglePlacesUtils';
import CONST from '../CONST';
import * as StyleUtils from '../styles/StyleUtils';

// The error that's being thrown below will be ignored until we fork the
// react-native-google-places-autocomplete repo and replace the
Expand Down Expand Up @@ -259,10 +260,7 @@ const AddressSearch = (props) => {
styles={{
textInputContainer: [styles.flexColumn],
listView: [
!displayListViewBorder && styles.googleListView,
displayListViewBorder && styles.borderTopRounded,
displayListViewBorder && styles.borderBottomRounded,
displayListViewBorder && styles.mt1,
StyleUtils.getGoolgeListViewStyle(displayListViewBorder),
styles.overflowAuto,
styles.borderLeft,
styles.borderRight,
Expand Down
20 changes: 20 additions & 0 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,25 @@ function getDirectionStyle(direction) {
return {};
}

/**
* @param {Boolean} shouldDisplayBorder
* @returns {Object}
*/
function getGoolgeListViewStyle(shouldDisplayBorder) {
if (shouldDisplayBorder) {
return {
...styles.borderTopRounded,
...styles.borderBottomRounded,
marginTop: 4,
paddingVertical: 6,
};
}

return {
transform: [{scale: 0}],
};
}

export {
getAvatarSize,
getAvatarStyle,
Expand Down Expand Up @@ -1032,4 +1051,5 @@ export {
getDirectionStyle,
getFontSizeStyle,
getSignInWordmarkWidthStyle,
getGoolgeListViewStyle,
};
4 changes: 0 additions & 4 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2800,10 +2800,6 @@ const styles = {
right: 60,
},

googleListView: {
transform: [{scale: 0}],
},

invert: {
// It's important to invert the Y AND X axis to prevent a react native issue that can lead to ANRs on android 13
transform: [{scaleX: -1}, {scaleY: -1}],
Expand Down