nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - NumberInput doesn't set the label placement provided in HeroUIProvider

Open stybo opened this issue 1 year ago • 13 comments

HeroUI Version

2.8.5

Describe the bug

<HeroUIProvider labelPlacement={"outside"} >

<div> <Input isRequired name={"total"} placeholder="Enter amount" label={"Total amount"} aria-label="Total" value={value} onValueChange={setValue} isClearable /> </div>

Image

<div> <NumberInput isRequired name={"total"} placeholder="Enter amount" label={"Total amount"} aria-label="Total" value={value} onValueChange={setValue} isClearable /> </div>

Image

When passing the labelPlacement manually it does work as expected

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Create a number input and provide the labelPlacement in HeroUIProvider

Expected behavior

should use the provided labelPlacment from HeroUIProivder

Screenshots or Videos

No response

Operating System Version

MacOS

Browser

Safari

stybo avatar Oct 24 '25 16:10 stybo

ENG-2860

linear[bot] avatar Oct 24 '25 16:10 linear[bot]

I'm wondering if you swapped two screenshots?

wingkwong avatar Oct 24 '25 17:10 wingkwong

No the first one is the normal input, where the label is automatically placed outside.

The second one is the number input where this doesn't happen automatically. I can set it manually by passing labelplacent="outside"

stybo avatar Oct 24 '25 23:10 stybo

Ah got it now. Thought <HeroUIProvider labelPlacement={"outside"} > is only for the first example. Will take a look. Thanks for reporting.

wingkwong avatar Oct 25 '25 04:10 wingkwong

@wingkwong can I work on this one?

villAsh avatar Oct 25 '25 07:10 villAsh

@villAsh go ahead

wingkwong avatar Oct 26 '25 05:10 wingkwong

@villAsh Any progress so far?

stybo avatar Oct 30 '25 09:10 stybo

@Stybo I tried a few things but due to some work reason will not be able to work on this.

Hey @wingkwong, can you please unassign this?

villAsh avatar Oct 30 '25 10:10 villAsh

@villAsh any findings you can share?

wingkwong avatar Oct 30 '25 10:10 wingkwong

If nobody is working on this bug, can I take it? :)

KumJungMin avatar Oct 31 '25 02:10 KumJungMin

@KumJungMin go ahead

wingkwong avatar Oct 31 '25 03:10 wingkwong

@villAsh any findings you can share?

I was exploring the number-input file and discovered that it is related to use-label-placement hook.

Inside of use-label-placement hook we are passing the labelPlacement prop and we are doing a check that if it is null then only take the global label placement, but the thing is that it might not be null...

this is what I've discovered so far.

villAsh avatar Nov 01 '25 07:11 villAsh

Good job @KumJungMin! @wingkwong When will this be available?

stybo avatar Nov 02 '25 11:11 stybo