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

Add char count and max char info near textarea of comments area #2944

Merged
merged 2 commits into from
Oct 1, 2019
Merged

Add char count and max char info near textarea of comments area #2944

merged 2 commits into from
Oct 1, 2019

Conversation

danielcaldas
Copy link
Contributor

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

#2859

What is the current behavior?

No information about character count. Also no limit on the textarea for comments.

What is the new behavior?

The new behavior is demonstrated in the below GIF.

counter-info

Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

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

Just a couple comments. Great work!


.comment__char-count {
align-self: flex-end;
font-size: 12px;
Copy link

Choose a reason for hiding this comment

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

Can you change this to font-size: var(--font-label);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@@ -141,10 +146,15 @@ export class FormField extends React.PureComponent<Props> {
</div>
);
} else if (type === 'textarea') {
const hasCharCount = charCount !== undefined && charCount >= 0;
const countInfo = hasCharCount && (
<span className="comment__char-count">{`${charCount || ''}/${textAreaMaxLength}`}</span>
Copy link

Choose a reason for hiding this comment

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

Instead of an empty string, this should just be 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sure, missed that one.

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Sep 30, 2019
@neb-b neb-b added the hacktoberfest Welcome to Hacktoberfest label Oct 1, 2019
@neb-b neb-b merged commit a445494 into lbryio:master Oct 1, 2019
@tzarebczan
Copy link
Contributor

@danielcaldas for the PR! Can we show you some appreciation?

Make sure to check out https://lbry.tech/contribute and sign up for the dev mailing list at the bottom!

Also, see https://lbry.com/news/hacktoberfest-2019 for the latest Hacktoberfest details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Welcome to Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants