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

Added default disabled styling to checkbox control. #1424

Merged
merged 1 commit into from
Apr 12, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [client] Fixed secret prompt dialog's opaque background so that it is now transparent in PR [1407](https://github.com/Microsoft/BotFramework-Emulator/pull/1407)
- [build / client] Fixed ipc issue that was breaking the command service in PR [1418](https://github.com/Microsoft/BotFramework-Emulator/pull/1418)
- [build] Bumped electron version to v4.1.1 and updated .dmg installer background image in PR [1419](https://github.com/Microsoft/BotFramework-Emulator/pull/1419)
- [ui-react] Added default disabled styling to checkbox control in PR [1424](https://github.com/Microsoft/BotFramework-Emulator/pull/1424)

## v4.3.3 - 2019 - 03 - 14
## Fixed
Expand Down
10 changes: 5 additions & 5 deletions packages/sdk/ui-react/src/widget/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
flex-flow: row nowrap;
color: var(--input-label-color);

&[disabled], &[aria-disabled] {
&.disabled, &[aria-disabled] {
color: var(--input-label-color-disabled);

.check-mark {
border: var(--checkbox-border-disabled);
}
}
}

Expand All @@ -22,10 +26,6 @@
background: transparent;
transition: background 75ms ease-in, border 75ms ease-in;

&[disabled], &[aria-disabled] {
border: var(--checkbox-border-disabled);
}

&::before {
content: '';
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This is a generated file. Changes are likely to result in being overwritten
export const checkbox: string;
export const label: string;
export const disabled: string;
export const checkMark: string;
export const checked: string;
export const indeterminate: string;
Expand Down
4 changes: 3 additions & 1 deletion packages/sdk/ui-react/src/widget/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export class Checkbox extends React.Component<CheckboxProps, CheckboxState> {
// Trim off what we don't want to send to the input tag
const { className, label = '', ...inputProps } = this.props;
const { checked = false, indeterminate = false, focused } = this.state;
const { disabled } = inputProps;
const disabledClass = disabled ? styles.disabled : '';
let checkMarkStyles = '';
if (indeterminate) {
checkMarkStyles = styles.indeterminate;
Expand All @@ -86,7 +88,7 @@ export class Checkbox extends React.Component<CheckboxProps, CheckboxState> {
checkMarkStyles += ` ${styles.focused}`;
}
return (
<label id={this.checkboxId} className={`${styles.label} ${className}`} data-checked={checked}>
<label id={this.checkboxId} className={`${styles.label} ${disabledClass} ${className}`} data-checked={checked}>
<span className={`${styles.checkMark} ${checkMarkStyles}`} />
<input type="checkbox" {...inputProps} className={styles.checkbox} ref={this.checkboxRef} readOnly={true} />
{label}
Expand Down