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

[charts] onAxisClick is not working on IOS #15857

Open
hhwang1864 opened this issue Dec 12, 2024 · 1 comment
Open

[charts] onAxisClick is not working on IOS #15857

hhwang1864 opened this issue Dec 12, 2024 · 1 comment
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module!

Comments

@hhwang1864
Copy link

hhwang1864 commented Dec 12, 2024

<LineChart
    xAxis={[
        {
            data: xAxisValues,
            scaleType: "point",
        },
    ]}
    bottomAxis={{
        tickLabelStyle: {
            angle: atrXDegreesOfRotation ?? 0,
            textAnchor: "middle",
        },
    }}
    grid={{ vertical: true, horizontal: true }}
    series={chartDataSet}
    margin={{}} 
    slotProps={{
        legend: {},
    }}
    onAxisClick={(event, d) => console.log("HIT4", event.target, d)}
/>

Current behavior

It behaves well on web and android, however onAxisClick is not working on IOS.

It does work when i use onMarkClick but i would like to click on the axis element instead of mark element.
Also it does seem like the targetted area is very small for users to click.

Your environment

System:
OS: macOS 15.1.1
Binaries:
Node: 22.9.0 - ~/.nvm/versions/node/v22.9.0/bin/node
npm: 10.9.0 - ~/.nvm/versions/node/v22.9.0/bin/npm
pnpm: Not Found
Browsers:
Chrome: 131.0.6778.109
Edge: Not Found
Safari: 18.1.1
npmPackages:
@emotion/react: 11.11.4 => 11.11.4
@emotion/styled: 11.11.5 => 11.11.5
@mui/base: 5.0.0-beta.40
@mui/core-downloads-tracker: 6.1.0
@mui/icons-material: 6.1.0 => 6.1.0
@mui/material: 6.1.0 => 6.1.0
@mui/private-theming: 6.1.0
@mui/styled-engine-sc: 6.1.0
@mui/system: 6.1.0
@mui/types: 7.2.16
@mui/utils: 6.1.0
@mui/x-charts: 7.23.0 => 7.23.0
@mui/x-charts-vendor: 7.20.0
@mui/x-data-grid: 7.23.0
@mui/x-data-grid-pro: 7.23.0 => 7.23.0
@mui/x-date-pickers: 7.7.1
@mui/x-date-pickers-pro: 7.23.0 => 7.23.0
@mui/x-internals: 7.23.0
@mui/x-license: 7.23.0
@mui/x-tree-view: 7.23.0
@mui/x-tree-view-pro: 7.23.0 => 7.23.0
@types/react: 18.3.3 => 18.3.3
react: 19.0.0-rc-4beb1fd8-20241118 => 19.0.0-rc-4beb1fd8-20241118
react-dom: 19.0.0-rc-4beb1fd8-20241118 => 19.0.0-rc-4beb1fd8-20241118
styled-components: 6.1.13
typescript: 5.6.2 => 5.6.2

Search keywords: chart onAxisClick

@hhwang1864 hhwang1864 added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 12, 2024
@github-actions github-actions bot added the component: charts This is the name of the generic UI component, not the React module! label Dec 12, 2024
@JCQuintas JCQuintas removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 12, 2024
@JCQuintas
Copy link
Member

We can reproduce de bug: https://codesandbox.io/p/sandbox/competent-elion-d8hg3j?file=%2Fsrc%2FDemo.tsx%3A21%2C19

It seems to have something to do with how ios handles the events, and we use pointevents for knowing which axis is being hit, but use a click event for the onAxisClick listener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

2 participants