Skip to content

Commit

Permalink
[v4] [core] fix(EditableText): do not use disabled text colors (#4983)
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya authored Oct 22, 2021
1 parent 04d29ad commit 86c7c9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
12 changes: 0 additions & 12 deletions packages/core/src/blueprint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,6 @@ $tree-intent-icon-colors-modern: (
}
}


// Contrast for disabled editable text
.#{$ns}-editable-text.#{$ns}-disabled {
> .#{$ns}-editable-text-content {
color: $pt-text-color-disabled;

.#{$ns}-dark & {
color: $pt-dark-text-color-disabled;
}
}
}

// Contrast for HTML tables
table.#{$ns}-html-table {
&.#{$ns}-html-table-striped {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const INPUT_ID = "EditableTextExample-max-length";
export interface IEditableTextExampleState {
alwaysRenderInput?: boolean;
confirmOnEnterKey?: boolean;
disabled?: boolean;
intent?: Intent;
maxLength?: number;
report?: string;
Expand All @@ -34,12 +35,15 @@ export interface IEditableTextExampleState {

export class EditableTextExample extends React.PureComponent<IExampleProps, IEditableTextExampleState> {
public state: IEditableTextExampleState = {
alwaysRenderInput: true,
alwaysRenderInput: false,
confirmOnEnterKey: false,
disabled: false,
report: "",
selectAllOnFocus: false,
};

private toggleDisabled = handleBooleanChange((disabled: boolean) => this.setState({ disabled }));

private handleIntentChange = handleValueChange((intent: Intent) => this.setState({ intent }));

private toggleSelectAll = handleBooleanChange(selectAllOnFocus => this.setState({ selectAllOnFocus }));
Expand All @@ -54,6 +58,7 @@ export class EditableTextExample extends React.PureComponent<IExampleProps, IEdi
<H1>
<EditableText
alwaysRenderInput={this.state.alwaysRenderInput}
disabled={this.state.disabled}
intent={this.state.intent}
maxLength={this.state.maxLength}
placeholder="Edit title..."
Expand All @@ -62,6 +67,7 @@ export class EditableTextExample extends React.PureComponent<IExampleProps, IEdi
</H1>
<EditableText
alwaysRenderInput={this.state.alwaysRenderInput}
disabled={this.state.disabled}
intent={this.state.intent}
maxLength={this.state.maxLength}
maxLines={12}
Expand Down Expand Up @@ -94,6 +100,7 @@ export class EditableTextExample extends React.PureComponent<IExampleProps, IEdi
value={this.state.maxLength || ""}
/>
</FormGroup>
<Switch checked={this.state.disabled} label="Disabled" onChange={this.toggleDisabled} />
<Switch
checked={this.state.selectAllOnFocus}
label="Select all on focus"
Expand Down

1 comment on commit 86c7c9d

@blueprint-bot
Copy link

Choose a reason for hiding this comment

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

[v4] [core] fix(EditableText): do not use disabled text colors (#4983)

Previews: documentation | landing | table | modern colors demo

Please sign in to comment.