Open czn574775237 opened 8 months ago
Just add this classNames slot to Input component to fix this:
<Input ... classNames={{ inputWrapper: [ "group-data-[focus-visible=true]:ring-0 group-data-[focus-visible=true]:ring-offset-0" ] }} ... />
Just add this classNames slot to Input component to fix this:
<Input ... classNames={{ inputWrapper: [ "group-data-[focus-visible=true]:ring-0 group-data-[focus-visible=true]:ring-offset-0" ] }} ... />
Crazy we have to do this lol. Problem is though, it disables the blue highlight permanently for tabbing around and accessibility.
How to fix?
const [hasBlurred, setHasBlurred] = useState(false)
<Input classNames={{
inputWrapper: cn(!hasBlurred ? ["group-data-[focus-visible=true]:ring-0 group-data-[focus-visible=true]:ring-offset-0"] : null)
}}
onBlur={() => setHasBlurred(true)}}
/>
A real fix would have autofocus simulate a click or something on the input, instead of a hard focus, so we don't get the blue outline initially.
I've tried this in autocomplete component, but didn't work. another solution?
Just add this classNames slot to Input component to fix this:
<Input ... classNames={{ inputWrapper: [ "group-data-[focus-visible=true]:ring-0 group-data-[focus-visible=true]:ring-offset-0" ] }} ... />
its to difficult change border color in nextui components 😢
NextUI Version
2.2.9
Describe the bug
When I use the component "Input" with autoFocus, it came with an unexpeced blue border around the input box. As I remove 'autoFocus', the border will not be display.
And I found the border is at the dom node
<div data-slot="input-wrapper" ... />
with thebox-shadow
.So I had to add this style to hide the border and it work.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Expected behavior
it came with an unexpeced blue border around the input box when the input setting autoFocus.
Screenshots or Videos
Operating System Version
Windows
Browser
Edge