Skip to content

Commit

Permalink
Merge pull request #263 from appfolio/updateSelectStyles
Browse files Browse the repository at this point in the history
gt - Update Select styles
  • Loading branch information
gthomas-appfolio authored Jul 12, 2017
2 parents ef43a5e + 830b9ff commit ed7976e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/components/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class Select extends Component {
};

static defaultProps = {
defaultValue: '',
onChange: noop,
onChange: noop
};

constructor(props) {
Expand Down
9 changes: 6 additions & 3 deletions src/components/Select.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
:global {
// Import and override react-select's SCSS variables to match BS4:
$select-input-border-width: 0.1rem;
$select-input-height: 2.4rem !default;
$select-input-height: 2.35rem !default;
$select-input-internal-height: 2.25rem !default;

// Override react-select styles to match Saffron (TODO move to theme?)
$select-input-bg-disabled: #eceeef;
$select-input-border-color: #d9d9d9;
$select-option-focused-bg: #3179cd;
$select-option-focused-color: #FFF;
$select-option-focused-bg: #00AFDB;
$select-text-color: #55595c;

// TODO correct inner padding, colors to match BS styles

Expand Down
4 changes: 2 additions & 2 deletions test/components/Address.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('<Address />', () => {
it('should update state', () => {
const input = component.find('[name="state"]');
assert.equal(input.prop('value'), 'NJ');
assert.equal(input.prop('defaultValue'), '');
assert.equal(input.prop('defaultValue'), null);

input.simulate('change', { label: 'New York', value: 'NY' });
assert(callback.calledWith(Object.assign({}, addressData, { state: 'NY' })));
Expand All @@ -176,7 +176,7 @@ describe('<Address />', () => {
it('should update country', () => {
const input = component.find('[name="countryCode"]');
assert.equal(input.prop('value'), 'US');
assert.equal(input.prop('defaultValue'), '');
assert.equal(input.prop('defaultValue'), null);

input.simulate('change', { label: 'USA', value: 'US' });
assert(callback.calledWith(Object.assign({}, addressData, { countryCode: 'US' })));
Expand Down
2 changes: 1 addition & 1 deletion test/components/Select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('<Select />', () => {

it('should have a blank default', () => {
assert.equal(component.type(), ReactSelect);
assert.equal(component.prop('value'), '');
assert.equal(component.prop('value'), null);
});

it('should clear input', () => {
Expand Down

0 comments on commit ed7976e

Please sign in to comment.