-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[pickers] When embedded inside iframe focus shifts to top of iframe when clicked #11522
Comments
Hello @prem-2301. Thank you for opening this issue. I've tried with the following setup: import * as React from "react";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
import { DatePicker } from "@mui/x-date-pickers/DatePicker";
import { Router, Routes, Route, Link } from "react-router-dom";
import { createBrowserHistory } from "history";
function BasicPicker() {
return (
<>
Some random text
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DatePicker label="Basic date picker" />
</LocalizationProvider>
</>
);
}
export default function PickerInIframe() {
const history = createBrowserHistory();
return (
<Router location={history.location} navigator={history}>
<Routes>
<Route
key="home"
path="/"
element={'Home'}
/>
<Route
key="iframe"
path="pickers-frame"
element={<BasicPicker />}
/>
</Routes>
<Link to="/">Home</Link>
<Link to="/pickers-frame" target="pickers_frame">
Open iframe
</Link>
<iframe name="pickers_frame" title="iFrame" width={500} height={450} />
</Router>
);
} |
The date picker code: The iframe code (where the issue is occuring): |
Thank you for providing a reproduction example. 👍 I also found the same question on StackOverflow. |
Hi, I looked into the stack solution but there's no such prop for DesktopDatePicker. Also, this issue is replicating on all browsers for us (Edge, Chrome, Brave) |
Thank you for your confirmation regarding browsers. 👌
Yes, such an exact prop does not exist and it's not that I would recommend the suggested solution, because it's just bad UX and a11y. 🙈 |
Is there any update? |
@prem-2301 , I have the exact same issue. have you found a solution by any chance ? |
Duplicates
Steps to reproduce 🕹
No response
Current behavior 😯
I using Date Picker from MUiX. And have embedded it in iframe on wordpress. When I click on the date picker icon to select date, the focus shifts to the top of the iframe.
Expected behavior 🤔
The focus should not shift from the date picker
Context 🔦
No response
Your environment 🌎
npx @mui/envinfo
Search keywords:
The text was updated successfully, but these errors were encountered: