viewerjs icon indicating copy to clipboard operation
viewerjs copied to clipboard

fix:temporary image misalignment when loading image slowly

Open SalengNotLittleMeng opened this issue 2 months ago • 0 comments

Summary

What kind of change does this PR introduce? (check at least one)

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update
  • [ ] Refactor
  • [ ] Docs
  • [ ] Build-related changes
  • [ ] Other, please describe:

If changing the UI of the default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • [ ] Yes
  • [x] No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari
  • [x] Edge
  • [ ] IE

If adding a new feature, the PR's description includes:

  • [ ] A convincing reason for adding this feature
  • [ ] Related documents have been updated
  • [ ] Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information: If in a slow network environment or with large image resources, it may cause the image to temporarily appear and be misaligned after one second of loading. This is because setTimeout is used as a fallback in the code. But this misalignment and flickering can lead to a bad experience, especially when the image loading time is between 1 s and 2 s. So I think maybe we should increase the configuration to prevent this behavior or allow developers to configure time delays themselves After 1 second image

The situation in the above picture will continue until the final display of the image image

SalengNotLittleMeng avatar Apr 25 '24 04:04 SalengNotLittleMeng