diff --git a/web/app/components/input/__button/_type/_preview/input__button_type_preview.scss b/web/app/components/input/__button/_type/_preview/input__button_type_preview.scss
index 66452156..5bbeaca8 100644
--- a/web/app/components/input/__button/_type/_preview/input__button_type_preview.scss
+++ b/web/app/components/input/__button/_type/_preview/input__button_type_preview.scss
@@ -1,5 +1,6 @@
.input__button_type_preview {
background: #fff;
+ color: #000;
&:hover, &:focus {
box-shadow: inset 0 0 0 2px #0aa;
diff --git a/web/app/components/input/__button/input__button.scss b/web/app/components/input/__button/input__button.scss
index 015daa0a..1424ed0f 100644
--- a/web/app/components/input/__button/input__button.scss
+++ b/web/app/components/input/__button/input__button.scss
@@ -10,4 +10,9 @@
&:focus {
outline: none;
}
+
+ &:disabled {
+ opacity: .5;
+ pointer-events: none;
+ }
}
diff --git a/web/app/components/input/input.jsx b/web/app/components/input/input.jsx
index babb5a9b..7902e5a5 100644
--- a/web/app/components/input/input.jsx
+++ b/web/app/components/input/input.jsx
@@ -18,6 +18,7 @@ export default class Input extends Component {
this.state = {
preview: null,
isErrorShown: false,
+ isDisabled: false,
maxLength: config.max_comment_size || DEFAULT_MAX_COMMENT_SIZE,
commentLength: 0,
};
@@ -94,7 +95,7 @@ export default class Input extends Component {
if (!text || !text.trim()) return;
- this.setState({ isFieldDisabled: true, isErrorShown: false });
+ this.setState({ isDisabled: true, isErrorShown: false });
const request = mods.mode === 'edit'
? api.edit({ text, id })
@@ -113,7 +114,7 @@ export default class Input extends Component {
.catch(() => {
this.setState({ isErrorShown: true });
})
- .finally(() => this.setState({ isFieldDisabled: false }));
+ .finally(() => this.setState({ isDisabled: false }));
}
getPreview() {
@@ -130,7 +131,7 @@ export default class Input extends Component {
});
}
- render(props, { isFieldDisabled, isErrorShown, preview, maxLength, commentLength }) {
+ render(props, { isDisabled, isErrorShown, preview, maxLength, commentLength }) {
const charactersLeft = maxLength - commentLength;
const { mods = {}, value = null, errorMessage } = props;
@@ -145,7 +146,7 @@ export default class Input extends Component {
onInput={this.onInput}
onKeyDown={this.onKeyDown}
ref={r => (this.fieldNode = r)}
- disabled={isFieldDisabled}
+ disabled={isDisabled}
/>
{
@@ -167,12 +168,14 @@ export default class Input extends Component {
{