File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @indec/react-commons" ,
3- "version" : " 7.1.0 " ,
3+ "version" : " 7.1.1 " ,
44 "description" : " Common reactjs components for apps" ,
55 "private" : false ,
66 "main" : " index.js" ,
99 "./Icons" : " ./components/Icons/index.js" ,
1010 "./hooks" : " ./hooks/index.js" ,
1111 "./utils" : " ./utils/index.js" ,
12- "./assets" : " ./assets/index.js"
12+ "./assets" : " ./assets/index.js" ,
13+ "./output.css" : " ./components/output.css"
1314 },
1415 "scripts" : {
1516 "start" : " start-storybook -p 6006" ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default function Select({
1717 const handleChange = selectedValue => {
1818 onSelect ( name , selectedValue ? selectedValue [ keyValue ] : undefined ) ;
1919 if ( onClean ) {
20- onClean ( form ) ;
20+ onClean ( ) ;
2121 }
2222 } ;
2323
@@ -44,7 +44,6 @@ export default function Select({
4444 setIsOpen ( true ) ;
4545 } }
4646 disabled = { disabled }
47- readOnly = { ! isOpen }
4847 />
4948 < div className = "absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none" >
5049 < ChevronDownIcon className = "w-5 h-5 text-gray-400" />
@@ -56,19 +55,22 @@ export default function Select({
5655 { loading ? (
5756 < div className = "px-3 py-2 text-gray-500" > Cargando...</ div >
5857 ) : filteredOptions . length > 0 ? (
59- filteredOptions . map ( ( option , index ) => (
60- < div
61- key = { index }
62- className = "px-3 py-2 hover:bg-blue-50 cursor-pointer"
63- onClick = { ( ) => {
64- handleChange ( option ) ;
65- setIsOpen ( false ) ;
66- setSearchTerm ( '' ) ;
67- } }
68- >
69- { option . label }
70- </ div >
71- ) )
58+ < div className = "flex flex-col" >
59+ { filteredOptions . map ( ( option , index ) => (
60+ < button
61+ key = { index }
62+ type = "button"
63+ className = "w-full px-3 py-2 text-left hover:bg-blue-50 cursor-pointer"
64+ onClick = { ( ) => {
65+ handleChange ( option ) ;
66+ setIsOpen ( false ) ;
67+ setSearchTerm ( '' ) ;
68+ } }
69+ >
70+ { option . label }
71+ </ button >
72+ ) ) }
73+ </ div >
7274 ) : (
7375 < div className = "px-3 py-2 text-gray-500" > No hay opciones</ div >
7476 ) }
You can’t perform that action at this time.
0 commit comments