Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 159f1a2

Browse files
authored
fix: LSDV-5112: Fix the disable state of submission button (#1378)
Co-authored-by: juliosgarbi <[email protected]>
1 parent 01cf4fe commit 159f1a2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/common/Button/Button.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
--button-color rgba(#000, 0.5)
2727
pointer-events none
2828
background-color #efefef
29+
box-shadow: inset 0px -1px 0px rgba(0,0,0,0.1);
30+
border: 1px solid rgba(137, 128, 152, 0.16);
2931

3032
&:hover
3133
box-shadow 0px 2px 4px rgba(#000, 0.05), inset 0px -1px 0px rgba(#000, 0.1), inset 0px 0px 0px 1px rgba(#000, 0.2)

src/common/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface ButtonProps extends HTMLButtonProps {
1818
waiting?: boolean;
1919
icon?: JSX.Element;
2020
tag?: CNTagName;
21-
look?: 'primary' | 'danger' | 'destructive' | 'alt' | 'outlined' | 'active';
21+
look?: 'primary' | 'danger' | 'destructive' | 'alt' | 'outlined' | 'active' | 'disabled';
2222
primary?: boolean;
2323
danger?: boolean;
2424
style?: CSSProperties;

src/components/BottomBar/Controls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const Controls = controlsInjector(observer(({ store, history, annotation
145145
buttons.push(
146146
<ButtonTooltip key="submit" title={title}>
147147
<Elem name="tooltip-wrapper">
148-
<Button aria-label="submit" disabled={disabled || submitDisabled} look="primary" onClick={async () => {
148+
<Button aria-label="submit" disabled={disabled || submitDisabled} look={(disabled || submitDisabled) ? 'disabled' : 'primary'} onClick={async () => {
149149
await store.commentStore.commentFormSubmit();
150150
store.submitAnnotation();
151151
}}>
@@ -160,7 +160,7 @@ export const Controls = controlsInjector(observer(({ store, history, annotation
160160
const isUpdate = sentUserGenerate || versions.result;
161161
const button = (
162162
<ButtonTooltip key="update" title="Update this task: [ Alt+Enter ]">
163-
<Button aria-label="submit" disabled={disabled || submitDisabled} look="primary" onClick={async () => {
163+
<Button aria-label="submit" disabled={disabled || submitDisabled} look={(disabled || submitDisabled) ? 'disabled' : 'primary'} onClick={async () => {
164164
await store.commentStore.commentFormSubmit();
165165
store.updateAnnotation();
166166
}}>

0 commit comments

Comments
 (0)