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

Text Field Auto Complete/Auto Fill Tab Behavior #42668

Open
jerrickhakim opened this issue Jun 17, 2024 · 4 comments
Open

Text Field Auto Complete/Auto Fill Tab Behavior #42668

jerrickhakim opened this issue Jun 17, 2024 · 4 comments
Assignees
Labels
component: autocomplete This is the name of the generic UI component, not the React module! component: text field This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@jerrickhakim
Copy link

jerrickhakim commented Jun 17, 2024

On text field component.

When the variant is set to outline and the auto complete prop is set upon clicking the auto complete suggestion on iOS the next input in the dom is not focused.

Filled and standard variants work as expected.

Here's is a example on the themes store I've also located:

https://minimals.cc/auth-demo/split/sign-up

trim.7F2158CF-20B5-4987-B1CA-D39B2618023C.MOV

Search keywords:

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 17, 2024
@zannager zannager added component: text field This is the name of the generic UI component, not the React module! component: autocomplete This is the name of the generic UI component, not the React module! labels Jun 17, 2024
@mnajdova
Copy link
Member

Can you create a minimal reproduction with the code too? It would help us debug.

@mnajdova mnajdova added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 18, 2024
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Jun 25, 2024
@github-actions github-actions bot reopened this Jun 25, 2024
@jerrickhakim
Copy link
Author

"use client";

// React
import { useRef, useState } from "react";

// Formkit
import { Formik } from "formik";

// UI
import TextField from "@mui/material/TextField";
import LoadingButton from "@mui/lab/LoadingButton";

// MUI
import Visibility from "@mui/icons-material/Visibility";
import VisibilityOff from "@mui/icons-material/VisibilityOff";
import InputAdornment from "@mui/material/InputAdornment";
import IconButton from "@mui/material/IconButton";

export default function LoginForm({ onSuccess = false, redirect = false }) {


  // Form ref
  const form = useRef();

  const [showPassword, setShowPassword] = useState(false);


  //
  // Form Submit Event
  //

  const handleSubmit = async ({ email, password }) => {

  };

  const handleClickShowPassword = () => setShowPassword((show) => !show);



  return (
    <Formik
      className="w-full"
      initialValues={{ email: "", password: "" }}
      validate={(values) => {
        const errors = {};
        if (!values.email) {
          errors.email = "Email is required";
        } else if (
          !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(values.email)
        ) {
          errors.email = "Invalid email";
        }

        if (!values.password) {
          errors.password = "Password is required";
        }
        return errors;
      }}
      onSubmit={(values, { setSubmitting }) => {
        setTimeout(() => {
          handleSubmit(values);
          setSubmitting(false);
        }, 400);
      }}
    >
      {({
        values,
        errors,
        touched,
        handleChange,
        handleBlur,
        handleSubmit,
        isSubmitting,
      }) => (
        <form onSubmit={handleSubmit} className="w-full" ref={form}>
          <TextField
            fullWidth
            color="input"
            id="email"
            label="Email*"
            variant="outlined"
            autoComplete="current-username"
            placeholder="[email protected]"
            onBlur={handleBlur}
            onChange={handleChange}
            value={values.email}
            error={errors.email && touched.email}
            helperText={errors.email && touched.email && errors.email}
            sx={{
              mb: 2,
            }}
          />

          <TextField
            fullWidth
            color="input"
            id="password"
            label="Password"
            autoComplete="current-password"
            variant="outlined"
            onBlur={handleBlur}
            onChange={handleChange}
            sx={{
              mb: 2,
            }}
            type={showPassword ? "text" : "password"}
            InputProps={{
              endAdornment: (
                <InputAdornment position="end">
                  <IconButton
                    aria-label="toggle password visibility"
                    onClick={handleClickShowPassword}
                    edge="end"
                  >
                    {showPassword ? <VisibilityOff /> : <Visibility />}
                  </IconButton>
                </InputAdornment>
              ),
            }}
            value={values.password}
            error={errors.password && touched.password}
            helperText={errors.password && touched.password && errors.password}
          />

          <LoadingButton
            fullWidth
            loading={isSubmitting}
            disabled={isSubmitting}
            type="submit"
            variant="contained"
            size="large"
            sx={{
              textTransform: "none",
            }}
          >
            Login
          </LoadingButton>
        </form>
      )}
    </Formik>
  );
}

@Burakhan
Copy link

Any progress? I have the same problem. When I remove the fieldset element in Outlined from the html, it works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! component: text field This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

5 participants