Skip to content

Commit d7f0afb

Browse files
authored
Merge pull request #294 from editor-js/fix/patch-2.10.3
fix: caption is not visible when the features.caption is set to true
2 parents 2cddffc + 36e5fce commit d7f0afb

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/eslint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
name: ESlint
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111

1212
- name: Cache node modules
13-
uses: actions/cache@v1
13+
uses: actions/cache@v4
1414
with:
1515
path: node_modules
1616
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@editorjs/image",
3-
"version": "2.10.2",
3+
"version": "2.10.3",
44
"keywords": [
55
"codex editor",
66
"image",

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export default class ImageTool implements BlockTool {
201201
public render(): HTMLDivElement {
202202
if (this.config.features?.caption === true || this.config.features?.caption === undefined || (this.config.features?.caption === 'optional' && this.data.caption)) {
203203
this.isCaptionEnabled = true;
204+
this.ui.applyTune('caption', true);
204205
}
205206

206207
return this.ui.render() as HTMLDivElement;
@@ -403,6 +404,8 @@ export default class ImageTool implements BlockTool {
403404

404405
if (data.caption) {
405406
this.setTune('caption', true);
407+
} else if (this.config.features?.caption === true) {
408+
this.setTune('caption', true);
406409
}
407410
}
408411

0 commit comments

Comments
 (0)