How to modify preview events

Open
#114 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start with the Image component's preview API and the custom preview example in the issue, then trace how the popup handles clicks on the modal and image. Done means clicking the popup image closes the preview without breaking the existing X-button and outside-modal behavior.

Written by the indexing model from the issue text.

Description

Following custom preview image demo:

<Image
      width={200}
      src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png?x-oss-process=image/blur,r_50,s_50/quality,q_1/resize,m_mfit,h_200,w_200"
      preview={{
        src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
      }}
/>

The only way to close the popup image is either: a) X button b) press on the modal (outside the image).

How is it possible to close the popup when clicking the image?

Using Image preview API modifies only the hover modal of the preview, and modal property of preview does the same.

Dominant language
TypeScript
Stars
211
Forks
128
Avg merge
2d 23h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-component/image

All issues in react-component/image

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.