Skip to content

Commit

Permalink
Remove autofocus on materias select
Browse files Browse the repository at this point in the history
Annoying on mobile
  • Loading branch information
FdelMazo committed Aug 21, 2023
1 parent eb0c0d5 commit 3eb308a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/components/MateriasDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,12 @@ const MateriasDrawer = (props) => {
return codigosUnicos.filter(ValidMateria).map(getMateria);
}, [selections.carreras]);

const buscarMateriaRef = React.useRef();

return (
<LightMode>
<Drawer
isOpen={isOpen}
placement="right"
onClose={onClose}
initialFocusRef={buscarMateriaRef}
>
<DrawerOverlay bg="blackAlpha.300" />
<DrawerContent
Expand All @@ -111,7 +108,7 @@ const MateriasDrawer = (props) => {
<Box pt={6} px={6}>
<SelectCarreras />
{!!materiasToShow.length && (
<SelectMateria ref={buscarMateriaRef} materiasToShow={materiasToShow} />
<SelectMateria materiasToShow={materiasToShow} />
)}
</Box>

Expand Down
6 changes: 3 additions & 3 deletions src/components/SelectMateria.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React from "react";
import { DataContext } from "../DataContext";
import { stateReducer } from "../utils";

const SelectMateria = React.forwardRef(({ materiasToShow }, ref) => {
const SelectMateria = ({ materiasToShow }) => {
const { toggleMateria, selections } = React.useContext(DataContext);
const [search, setSearch] = React.useState("");

Expand Down Expand Up @@ -46,7 +46,7 @@ const SelectMateria = React.forwardRef(({ materiasToShow }, ref) => {
<InputGroup w="100%" fontFamily="general" mt={4} mb={2}>
<Input
{...getToggleButtonProps()}
{...getInputProps({ ref })}
{...getInputProps()}
colorScheme="primary"
variant="outline"
borderColor="primary"
Expand Down Expand Up @@ -108,6 +108,6 @@ const SelectMateria = React.forwardRef(({ materiasToShow }, ref) => {
</List>
</>
);
});
};

export default SelectMateria;

0 comments on commit 3eb308a

Please sign in to comment.