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

Force rerender on image load to recalculate caption visibility #2652

Merged

Conversation

cpoftea
Copy link
Contributor

@cpoftea cpoftea commented Nov 21, 2024

Description:

Caption visibility depends on <img> width. But initially rendered <img> has no image source loaded, so <img> is small. After image loaded, it didn't trigger any React re-renders, so caption being hidden until follow up interactions with RTE occurs. When RTE initially rendered in readonly view, no follow up interactions can occur. So we need to force re-rerender image component when image source loaded.

Issue link:

Closes #2650

QA notes:

Test RTE images(resizing, load, caption)

Copy link

github-actions bot commented Nov 21, 2024

Generated by: track-bundle-size
Generated at: Thu, 21 Nov 2024 15:29:31 GMT
Bundle size diff (in kBytes). Not gzipped. Both CSS & JS included.
Baseline: v5.10.0 (2024-10-15)
CI Status: ok

Module Baseline Size
(v5.10.0)
Size Diff Within
Threshold
Threshold
(min - max)
templateApp 760.53 767.47 +6.94
js:+3.93
css:+3.01
🆗 684.48 - 836.59
@epam/app 5578.86 5634.65 +55.78
js:+4.7
css:+51.08
🆗 5020.98 - 6136.75
@epam/draft-rte 53.77 53.78 +0.01
js:+0
css:+0.01
🆗 48.39 - 59.15
@epam/electric 4.57 4.58 +0.01
js:+0.01
css:0
🆗 4.12 - 5.03
@epam/promo 57.15 55.24 -1.91
js:-1.44
css:-0.48
🆗 51.44 - 62.87
@epam/uui-extra 0.21 0.21 0
js:0
css:0
🆗 0.19 - 0.23
@epam/loveship 93.74 91.19 -2.54
js:-2.23
css:-0.32
🆗 84.36 - 103.11
@epam/uui-components 263.21 264.22 +1.01
js:+1.03
css:-0.02
🆗 236.89 - 289.54
@epam/uui-core 337.45 338.13 +0.69
js:+0.69
css:0
🆗 303.7 - 371.19
@epam/uui-db 44.7 44.7 0
js:0
css:0
🆗 40.23 - 49.17
@epam/uui-docs 207.12 207.12 0
js:0
css:0
🆗 186.41 - 227.83
@epam/uui-editor 183.61 184.24 +0.62
js:+0.61
css:+0.01
🆗 165.25 - 201.97
@epam/uui-timeline 79.51 80.98 +1.47
js:+1.47
css:0
🆗 71.56 - 87.46
@epam/uui 606.81 611.81 +5
js:+2.5
css:+2.5
🆗 546.13 - 667.49
new sizes (raw)

To set the sizes as a new baseline, you can copy/paste next content to the uui-build/config/bundleSizeBaseLine.json and commit the file.

{
  "version": "5.11.0",
  "timestamp": "2024-11-21",
  "sizes": {
    "templateApp": {
      "css": 303125,
      "js": 482768
    },
    "@epam/app": {
      "css": 731275,
      "js": 5038602
    },
    "@epam/draft-rte": {
      "css": 9782,
      "js": 45296
    },
    "@epam/electric": {
      "css": 2275,
      "js": 2416
    },
    "@epam/promo": {
      "css": 47140,
      "js": 9424
    },
    "@epam/uui-extra": {
      "css": 0,
      "js": 213
    },
    "@epam/loveship": {
      "css": 53117,
      "js": 40268
    },
    "@epam/uui-components": {
      "css": 22508,
      "js": 248053
    },
    "@epam/uui-core": {
      "css": 0,
      "js": 346246
    },
    "@epam/uui-db": {
      "css": 0,
      "js": 45769
    },
    "@epam/uui-docs": {
      "css": 2447,
      "js": 209641
    },
    "@epam/uui-editor": {
      "css": 12746,
      "js": 175908
    },
    "@epam/uui-timeline": {
      "css": 2254,
      "js": 80669
    },
    "@epam/uui": {
      "css": 280340,
      "js": 346153
    }
  }
}

Generated by: generate-components-api
CI Status: ok

Total amount of exported types/props without JSDoc comments

Amount
Types 301 (+0) 🆗
Props 233 (+0) 🆗

@cpoftea cpoftea force-pushed the fix/image-caption-at-initial-ro-view branch from 6b4c7e6 to 14ab0d1 Compare November 21, 2024 15:23
@AlekseyManetov AlekseyManetov merged commit 91b9eed into epam:develop Nov 21, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants