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

Update disabled Select style #337

Merged
merged 2 commits into from
Nov 22, 2017
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
8 changes: 7 additions & 1 deletion src/components/Select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$select-input-internal-height: 2.25rem !default;

// Override react-select styles to match Saffron (TODO move to theme?)
$select-input-bg-disabled: inherit;
$select-input-bg-disabled: #eceeef;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to avoid hard-coding colors, but I think it's fine in this case given the limitations of react-select and because #eceeef matches the saffron and MyCase themes.

$select-input-border-color: #d9d9d9;
$select-option-focused-bg: inherit;
$select-option-focused-color: inherit;
Expand All @@ -14,6 +14,12 @@

@import '~react-select-plus/scss/default.scss';

.Select {
&.is-disabled > .Select-control {
cursor: not-allowed;
}
}

// The default right padding for the input is 10px, which puts the cursor quite deep into the
// component. By reducing this to 0.5rem the input looks more natural and the cursor does not
// overlap any placeholder text.
Expand Down
3 changes: 2 additions & 1 deletion stories/Select.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Select } from '../src';
import { action, storiesOf } from '@storybook/react';
import { select } from '@storybook/addon-knobs';
import { boolean, select } from '@storybook/addon-knobs';

import COUNTRIES from '../src/components/address/Countries.js';

Expand All @@ -10,6 +10,7 @@ storiesOf('Select', module)
<div>
<Select
className="w-100"
disabled={boolean('disabled', false)}
options={COUNTRIES}
onChange={action('onChange')}
/>
Expand Down