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

Fix issue of button not disabled while adding todo without title #249

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion webapp/src/components/add_issue/add_issue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default class AddIssue extends React.PureComponent {
<React.Fragment>
<TextareaAutosize
style={style.textareaResizeMessage}
placeholder='Enter a title'
placeholder='Enter a title *'
Copy link
Contributor

Choose a reason for hiding this comment

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

We usally want the asterisk to be red or probably error-text class in this case. Also this should be a hint and not placeholder right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mickmister The TextareaAutosize component doesn't have any hint prop in it. Also, the placeholder only supports string type, that's why we were not able to update the color.
Should we add a label element and add stylings to support this?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's an external library we're using here. If it's not trivial to change the color of the asterisk, then maybe we just don't use an asterisk here. @asaadmahmood What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

@asaadmahmood Gentle reminder for this

Copy link
Contributor

Choose a reason for hiding this comment

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

@asaadmahmood Gentle reminder for this

Copy link
Contributor

Choose a reason for hiding this comment

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

@ayusht2810 We can get rid of the asterik, the button is disabled, its fine that the title needs to be entered.

autoFocus={true}
onKeyDown={(e) => this.onKeyDown(e)}
value={message}
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/widget/buttons/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Props = {
danger?: boolean
className?: string
rightIcon?: boolean
disabled?: boolean
}

function Button(props: Props): JSX.Element {
Expand All @@ -40,6 +41,7 @@ function Button(props: Props): JSX.Element {
className={generateClassName(classNames)}
title={props.title}
onBlur={props.onBlur}
disabled={props.disabled}
>
{!props.rightIcon && props.icon}
<span>{props.children}</span>
Expand Down
Loading