Skip to content

Commit

Permalink
Fix native dropdown
Browse files Browse the repository at this point in the history
alexplumb committed Jul 17, 2019
1 parent 205043c commit d799951
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.1] - 2019-07-17
### Fixed
- [Changed the phone number format for Sweden](https://github.com/alexplumb/material-ui-phone-number/pull/19)
- Update lodash for security vulnerability
- [Removed reliance on theme providers](https://github.com/alexplumb/material-ui-phone-number/issues/18)

## [2.0.0-beta0] - 2019-05-02
### Added
- Added support for a new `native` property for people who want to use a native select for the button dropdown
13 changes: 4 additions & 9 deletions src/components/index.jsx
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ import Item from './Item';
import '../styles.less';
import '../flags.png';

const styles = theme => ({
const styles = () => ({
flagButton: {
minWidth: 30,
padding: 0,
@@ -28,24 +28,18 @@ const styles = theme => ({
width: 30,
height: 30,
padding: 8,

'&:before,&:after': {
display: 'none',
},
},
nativeRoot: {
padding: 0,

'& > svg': {
'& + svg': {
display: 'none',
},
},
nativeSelect: {
padding: 0,
lineHeight: 0,
margin: theme.spacing(1) * -1,
height: `calc(100% + ${theme.spacing(2)}px)`,
width: `calc(100% + ${theme.spacing(2)}px)`,
height: 11,
},
positionStart: {
position: 'relative',
@@ -757,6 +751,7 @@ class MaterialUiPhoneNumber extends React.Component {
select: classes.nativeSelect,
}}
onChange={e => this.handleFlagItemClick(e.target.value)}
disableUnderline
>
{!!preferredCountries.length && map(preferredCountries, (country, index) => (
<Item
2 changes: 1 addition & 1 deletion src/styles.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.flag {
width: 16px;
height: 11px;
background: url("./flags.png");
background-image: url("./flags.png") !important;

&.margin {
margin-right: 8px;

0 comments on commit d799951

Please sign in to comment.