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 an inputRange component like the basic inputNumber components #52067

Open
1 task done
jcreach opened this issue Nov 15, 2023 · 8 comments · May be fixed by #55583
Open
1 task done

Add an inputRange component like the basic inputNumber components #52067

jcreach opened this issue Nov 15, 2023 · 8 comments · May be fixed by #55583
Labels
area-blazor Includes: Blazor, Razor Components help wanted Up for grabs. We would accept a PR to help resolve this issue
Milestone

Comments

@jcreach
Copy link

jcreach commented Nov 15, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I'm building a form in blazor in which I use simple components like inputText and inputNumber, but I need an input of type range and I haven't found it in the framework.

Describe the solution you'd like

I'd like this component to be added. I can propose a first version because I've started to prototype it for the needs of my project based on the inputNumber component.

Additional context

No response

Summary comment: #52067 (comment)

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Nov 15, 2023
@javiercn javiercn added the help candidate Indicates that the issues may be a good fit for community to help with. Requires work from eng. team label Nov 15, 2023
@SteveSandersonMS
Copy link
Member

I think <InputNumber type="range" ... /> works for this purpose. Can you try this and let us know if something seems missing?

@jcreach
Copy link
Author

jcreach commented Nov 15, 2023

Thanks for your reply. I've just tried again and it doesn't work, the range type isn't taken into account...

Here is my code:

<label for="range">Range : </label>
<InputNumber type="range" @bind-Value="data.Range" />
<p>@data.Range</p>

Here is the result:

image

@SteveSandersonMS
Copy link
Member

Ah right yes, I see. I was thinking of <input type="range" @bind="data.Range" />, which does work.

So I think this is a valid feature request, but it might be that we'd achieve it by making <InputNumber type="range"> work. It looks like that would be a one-line change, i.e., swapping the order of these two lines:

builder.AddMultipleAttributes(2, AdditionalAttributes);
builder.AddAttribute(3, "type", "number");

@MackinnonBuck MackinnonBuck added this to the Backlog milestone Nov 15, 2023
@ghost
Copy link

ghost commented Nov 15, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@MackinnonBuck
Copy link
Member

@jcreach It looks like this can be made to work with a fairly simple change as suggested by @SteveSandersonMS. Would you be interested in making that contribution?

@MackinnonBuck MackinnonBuck added the help wanted Up for grabs. We would accept a PR to help resolve this issue label Nov 15, 2023
@ghost
Copy link

ghost commented Nov 15, 2023

Looks like this issue has been identified as a candidate for community contribution. If you're considering sending a PR for this issue, look for the Summary Comment link in the issue description. That comment has been left by an engineer on our team to help you get started with handling this issue. You can learn more about our Help Wanted process here

@MackinnonBuck MackinnonBuck removed the help candidate Indicates that the issues may be a good fit for community to help with. Requires work from eng. team label Nov 15, 2023
@jcreach
Copy link
Author

jcreach commented Nov 16, 2023

@MackinnonBuck Yes, of course I want to make the changes. Do I need to make a design proposal?

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@divyeshio
Copy link
Contributor

Hi, I would like to contribute to this. Can someone please assign this issue to me?
Based on this comment, I managed to write an E2E test for it but for Unit test how do I access "type" attribute after await InputRenderer.RenderAndGetComponent() here.

Do we need something like InputDateType and a field like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components help wanted Up for grabs. We would accept a PR to help resolve this issue
Projects
None yet
6 participants