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

medium-image-zoom affect the image display #817

Open
tjx666 opened this issue Jan 26, 2025 · 1 comment
Open

medium-image-zoom affect the image display #817

tjx666 opened this issue Jan 26, 2025 · 1 comment
Assignees
Labels

Comments

@tjx666
Copy link

tjx666 commented Jan 26, 2025

With Zoom component:

import Zoom from 'react-medium-image-zoom';
import 'react-medium-image-zoom/dist/styles.css';

function App() {
  return (
    <div
      style={{
        margin: '20px',
        height: '100px',
        width: '100px',
        border: '2px solid red',
      }}
    >
      <Zoom>
        <img
          src="https://cdn.artiffuse.ai/generations/images/mu8ADtP5h9V0KcIHFoUEA_576x1024_20250122_230143_raw.webp"
          style={{
            maxWidth: '100%',
            maxHeight: '100%',
            objectFit: 'contain',
          }}
        />
      </Zoom>
    </div>
  );
}

export default App;

image height overflow:

Image

No Zoom component, the image fit the div size:

Image

online reproduce: https://stackblitz.com/edit/vitejs-vite-hgyeoboh?file=src%2FApp.tsx

@rpearce
Copy link
Owner

rpearce commented Jan 28, 2025

Hi, I'll check this out when I get some time! Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants