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 MaxLength parameter for InputNumber #3455

Merged
merged 6 commits into from
Oct 21, 2023

Conversation

chazikaifa
Copy link
Contributor

@chazikaifa chazikaifa commented Oct 13, 2023

Add MaxLength parameter for InputNumber.

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

InputNumber doesn't have attribute for maxlength #3454

💡 Background and solution

As described in the issue, the parameter Max and Min can NOT completely replace the function of maxlength for the component <InputNumber>. Parameter Maxlength is added and apply to the <input>.

📝 Changelog

Language Changelog
🇺🇸 English Add MaxLength parameter for InputNumber
🇨🇳 Chinese 数字输入框添加MaxLength属性

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

Add MaxLength parameter for InputNumber.
@github-actions
Copy link

github-actions bot commented Oct 13, 2023

Prepare preview

@chazikaifa
Copy link
Contributor Author

@dotnet-policy-service agree

@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f469aea) 45.39% compared to head (b13bfbf) 43.62%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3455      +/-   ##
==========================================
- Coverage   45.39%   43.62%   -1.77%     
==========================================
  Files         560      560              
  Lines       26851    26849       -2     
  Branches      268     5453    +5185     
==========================================
- Hits        12190    11714     -476     
+ Misses      14621    14176     -445     
- Partials       40      959     +919     
Files Coverage Δ
components/input-number/InputNumber.razor 90.64% <100.00%> (-0.05%) ⬇️
components/input-number/InputNumber.razor.cs 62.03% <100.00%> (-8.54%) ⬇️

... and 151 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -59,6 +59,9 @@ public TValue DefaultValue
[Parameter]
public TValue Min { get; set; }

[Parameter]
public int MaxLength { get; set; } = -1;
Copy link
Member

Choose a reason for hiding this comment

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

Please set the default value to null so that the maxlength attribute would not be generated by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your reply! Updated in the latest commit.

Copy link
Member

Choose a reason for hiding this comment

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

The property type also need to be nullable int?

@ElderJames
Copy link
Member

Thanks for contribution @chazikaifa , plase updaet the API doc for the component.

@ElderJames
Copy link
Member

Hello @chazikaifa ,please change the type to int? for the parameter.

@chazikaifa
Copy link
Contributor Author

Hello @chazikaifa ,please change the type to int? for the parameter.

Sorry for taking so long. I cannot push code in my working place and my private VPN is down these days.

Copy link
Member

@ElderJames ElderJames left a comment

Choose a reason for hiding this comment

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

LGTM

@ElderJames ElderJames merged commit 7578335 into ant-design-blazor:master Oct 21, 2023
5 of 6 checks passed
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