Skip to content

Fix selected flag overlaps other components #397

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
40 changes: 20 additions & 20 deletions src/components/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,26 +1283,6 @@ class IntlTelInput extends Component {

return (
<div className={wrapperClass} style={wrapperStyle}>
<FlagDropDown
refCallback={this.setFlagDropdownRef}
allowDropdown={this.allowDropdown}
dropdownContainer={this.dropdownContainer}
separateDialCode={this.props.separateDialCode}
dialCode={this.state.dialCode}
clickSelectedFlag={this.clickSelectedFlag}
setFlag={this.setFlag}
countryCode={this.state.countryCode}
isMobile={this.isMobile}
handleSelectedFlagKeydown={this.handleSelectedFlagKeydown}
changeHighlightCountry={this.changeHighlightCountry}
countries={this.countries}
showDropdown={this.state.showDropdown}
inputTop={this.state.offsetTop}
inputOuterHeight={this.state.outerHeight}
preferredCountries={this.preferredCountries}
highlightedCountry={this.state.highlightedCountry}
titleTip={titleTip}
/>
<TelInput
refCallback={this.setTelRef}
handleInputChange={this.handleInputChange}
Expand All @@ -1324,6 +1304,26 @@ class IntlTelInput extends Component {
inputProps={this.props.telInputProps}
cursorPosition={this.state.cursorPosition}
/>
<FlagDropDown
refCallback={this.setFlagDropdownRef}
allowDropdown={this.allowDropdown}
dropdownContainer={this.dropdownContainer}
separateDialCode={this.props.separateDialCode}
dialCode={this.state.dialCode}
clickSelectedFlag={this.clickSelectedFlag}
setFlag={this.setFlag}
countryCode={this.state.countryCode}
isMobile={this.isMobile}
handleSelectedFlagKeydown={this.handleSelectedFlagKeydown}
changeHighlightCountry={this.changeHighlightCountry}
countries={this.countries}
showDropdown={this.state.showDropdown}
inputTop={this.state.offsetTop}
inputOuterHeight={this.state.outerHeight}
preferredCountries={this.preferredCountries}
highlightedCountry={this.state.highlightedCountry}
titleTip={titleTip}
/>
</div>
)
}
Expand Down
11 changes: 3 additions & 8 deletions src/intlTelInput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ $mobilePopupMargin: 30px;
// specify types to increase specificity e.g. to override bootstrap v2.3
input, input[type=text], input[type=tel] {
position: relative;
// input is bottom level, below selected flag and dropdown
z-index: 0;

// any vertical margin the user has on their inputs would no longer work as expected
// because we wrap everything in a container div. i justify the use of !important
Expand Down Expand Up @@ -75,11 +73,11 @@ $mobilePopupMargin: 30px;
right: 0;
// prevent the highlighted child from overlapping the input border
padding: $borderWidth;

.arrow {
font-size: 6px;
margin-left: 5px;

&.up:after {
content: '▲';
}
Expand All @@ -92,8 +90,6 @@ $mobilePopupMargin: 30px;
}

.selected-flag {
// render above the input
z-index: 1;
position: relative;
width: $selectedFlagWidth;
// this must be full-height both for the hover highlight, and to push down the
Expand All @@ -115,7 +111,7 @@ $mobilePopupMargin: 30px;
list-style: none;
// in case any container has text-align:center
text-align: left;

.divider {
padding-bottom: 5px;
margin-bottom: 5px;
Expand Down Expand Up @@ -184,7 +180,6 @@ $mobilePopupMargin: 30px;
.flag-container {
right: auto;
left: 0;
width: 100%;
}
.selected-flag {
width: $selectedFlagArrowWidth;
Expand Down