Skip to content

Commit

Permalink
Fix input disabled style (#1636)
Browse files Browse the repository at this point in the history
* fix: textarea disabled

* fix: input disabled

* fix: select disabled

* fix: placeholder color

* fix: select props

* fix: mobile safari

* fix: ie11

* fix: ie11

* 不要となった確認用storyを削除

* fix: css comment
  • Loading branch information
AtsushiM authored Jun 24, 2021
1 parent 9fd9791 commit dae134b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const StyledInput = styled.input<
color: ${palette.TEXT_BLACK};
line-height: 1.6;
box-sizing: border-box;
background-color: transparent;
&::placeholder {
color: ${palette.TEXT_GREY};
Expand Down
10 changes: 9 additions & 1 deletion src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const Wrapper = styled.div<{
`}
${disabled &&
css`
background-color: ${palette.BASE_GREY};
background-color: ${palette.COLUMN};
color: ${palette.TEXT_DISABLED};
`}
`
Expand Down Expand Up @@ -160,6 +160,14 @@ const SelectBox = styled.select<{ themes: Theme }>`
opacity: 1;
}
/* for IE11 */
&:disabled {
&,
&::-ms-value {
color: ${palette.TEXT_DISABLED};
}
}
&::-ms-expand {
display: none;
}
Expand Down
11 changes: 10 additions & 1 deletion src/components/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const StyledTextarea = styled.textarea<Props & { themes: Theme; textAreaWidth?:
background-color: #fff;
border: ${frame.border.default};
box-sizing: border-box;
opacity: 1;
${error
? css`
border-color: ${palette.DANGER};
Expand All @@ -96,10 +97,18 @@ const StyledTextarea = styled.textarea<Props & { themes: Theme; textAreaWidth?:
border-color: ${palette.hoverColor(palette.MAIN)};
}
`}
&::placeholder {
color: ${palette.TEXT_GREY};
}
&[disabled] {
background-color: ${palette.COLUMN};
pointer-events: none;
color: ${palette.TEXT_DISABLED};
&,
&::placeholder {
color: ${palette.TEXT_DISABLED};
}
}
`
}}
Expand Down

0 comments on commit dae134b

Please sign in to comment.