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

[TreeView] Icons getting bigger in production environment in safari #9970

Closed
2 tasks done
sayinmehmet47 opened this issue Aug 7, 2023 · 2 comments
Closed
2 tasks done
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@sayinmehmet47
Copy link

sayinmehmet47 commented Aug 7, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps:

  1. I am using mui tree component to create folder structure.
  2. It is working fine in other then safari browser perfectly in all environments
image

Current behavior 😯

The icons size and the child folders left padding is not correct in safari Version 15.6.1. But it works well in all other browsers and last safari version.

image

Expected behavior 🤔

The icons size and left padding of the child folders should shown like in the picture

image

Context 🔦

seems "css-yuu8jj" missing in styles in safari
Screenshot 2023-08-09 at 09 01 52

see in chrome it does not
Screenshot 2023-08-09 at 09 04 49

want to share some of my code

import cn from 'classnames';
import { forwardRef, type Ref } from 'react';
import { useTreeItem, TreeItemContentProps } from '@mui/lab/TreeItem';

export const TreeViewCustomComponent = forwardRef(function CustomContent(
  props: TreeItemContentProps,
  ref
) {
  const {
    classes,
    className,
    label,
    nodeId,
    icon: iconProp,
    expansionIcon,
    displayIcon,
  } = props;

  const {
    disabled,
    expanded,
    selected,
    focused,
    handleExpansion,
    handleSelection,
    preventSelection,
  } = useTreeItem(nodeId);

  const icon = iconProp ?? expansionIcon ?? displayIcon;

  const handleMouseDown = (
    event: React.MouseEvent<HTMLDivElement, MouseEvent>
  ) => {
    preventSelection(event);
  };

  const handleExpansionClick = (
    event: React.MouseEvent<HTMLDivElement, MouseEvent>
  ) => {
    handleExpansion(event);
  };

  const handleSelectionClick = (
    event: React.MouseEvent<HTMLDivElement, MouseEvent>
  ) => {
    handleSelection(event);
  };

  return (
    // eslint-disable-next-line jsx-a11y/no-static-element-interactions
    <div
      className={cn(className, classes.root, {
        [classes.expanded]: expanded,
        [classes.selected]: selected,
        [classes.focused]: focused,
        [classes.disabled]: disabled,
      })}
      onMouseDown={handleMouseDown}
      ref={ref as Ref<HTMLDivElement>}
    >
      {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
      <div onClick={handleExpansionClick} className={classes.iconContainer}>
        {icon}
      </div>
      {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
      <div onClick={handleSelectionClick} className={classes.label}>
        {label}
      </div>
    </div>
  );
});

No response

Your environment 🌎

npx @mui/envinfo
    "@mui/base": "5.0.0-beta.8",
    "@mui/lab": "5.0.0-alpha.137",
    "@mui/material": "5.14.2",

Safari

Version 15.6.1 (17613.3.9.1.16)
@sayinmehmet47 sayinmehmet47 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 7, 2023
@sayinmehmet47 sayinmehmet47 changed the title Mui Tree Viewer component behave weirdly in production Mui Tree Viewer component behave weirdly in production environment in safari Aug 7, 2023
@sayinmehmet47 sayinmehmet47 changed the title Mui Tree Viewer component behave weirdly in production environment in safari Mui Tree Viewer component icons getting bigger in production environment in safari Aug 7, 2023
@zannager zannager added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Aug 8, 2023
@zannager zannager transferred this issue from mui/material-ui Aug 8, 2023
@flaviendelangle
Copy link
Member

Hi,
Thanks for your contribution.

Could you provide a working reproduction, this Codesandbox template might be a good starting point.

@flaviendelangle flaviendelangle 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 Aug 14, 2023
@flaviendelangle flaviendelangle changed the title Mui Tree Viewer component icons getting bigger in production environment in safari [TreeView] Icons getting bigger in production environment in safari Aug 14, 2023
@github-actions
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

3 participants