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(pro:textarea): placeholder color for textarea #1512

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

kovsu
Copy link
Member

@kovsu kovsu commented Mar 24, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

企业微信截图_16796578341830

What is the new behavior?

input 的 placeholder 颜色和 textarea 的 placeholder 颜色不一样,在 components 的 style mixins 中定义了一个 placeholder 的 less 方法,在 pro 里面没有。所以在 pro 里面添加了这个方法,并且在 textarea 使用。

Other information

&:placeholder-shown {
text-overflow: ellipsis;
}
}
Copy link

Choose a reason for hiding this comment

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

with the code review

  1. The code is properly indented and easy to read.
  2. The code follows the correct syntax and there are no typos.
  3. The comment provided is helpful in understanding the code.
  4. The opacity override is necessary for Firefox, but this may be handled differently depending on the browser.
  5. The use of the placeholder-shown selector should be tested to make sure it works as expected in all browsers.
  6. The color value is set using a variable, which is good practice.
  7. The text-overflow property should be tested to make sure it works correctly in all browsers.

@@ -130,6 +131,7 @@
width: 100%;
resize: none;
overflow: hidden;
.placeholder(@textarea-placeholder-color);

&[disabled] {
cursor: not-allowed;
Copy link

Choose a reason for hiding this comment

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

the code review:

  1. At line 1, you have imported the placeholder.less mixin. This is good practice as it allows you to reuse code and keep your codebase organized.

  2. At line 130, you have added a placeholder mixin which sets the textarea-placeholder-color variable. This will help ensure consistent styling across different textareas.

  3. At line 131, you have added a statement that sets the cursor to not-allowed when the textarea is disabled. This will prevent accidental changes to the textarea while still providing feedback to the user.

Overall, this is a well written patch that ensures consistent styling and prevents accidental changes.

@idux-bot
Copy link

idux-bot bot commented Mar 24, 2023

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #1512 (729ae32) into main (703122f) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 729ae32 differs from pull request most recent head 7f13759. Consider uploading reports for the commit 7f13759 to get more accurate results

@@           Coverage Diff           @@
##             main    #1512   +/-   ##
=======================================
  Coverage   92.75%   92.75%           
=======================================
  Files         331      331           
  Lines       30801    30801           
  Branches     3533     3534    +1     
=======================================
  Hits        28568    28568           
  Misses       2233     2233           
Impacted Files Coverage Δ
packages/components/button/src/Button.tsx 95.37% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -1,3 +1,4 @@
@import '../../style/mixins/placeholder.less';
Copy link
Member

Choose a reason for hiding this comment

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

@import '../../../components/style//mixins/placeholder.less';

直接用 components 里的就好了。

@@ -130,6 +131,7 @@
width: 100%;
resize: none;
overflow: hidden;
.placeholder(@textarea-placeholder-color);

&[disabled] {
cursor: not-allowed;
Copy link

Choose a reason for hiding this comment

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

  1. The code looks good and there is no obvious bug risk.
  2. It would be better to add a comment above the @import statement to indicate what the placeholder.less file contains, as it can help with understanding the code better.
  3. The statement ".placeholder(@textarea-placeholder-color);" should be added inside a media query if it is necessary to keep the code responsive.

@danranVm danranVm merged commit 521ac8d into IDuxFE:main Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants