SVG Icon Disappears When Using buttonContent in ImageTool Configuration
- Dominant language
- TypeScript
- Stars
- 285
- Forks
- 307
- PR merge metrics
- No merged PRs in 30d
Description
When the `buttonContent` property is set in the configuration for the `ImageTool` of EditorJS, the SVG icon disappears, leaving only the text message visible.
## Examples:
### Example 1:
```javascript
import ImageTool from '@editorjs/image';
var editor = EditorJS({
...
tools: {
...
image: {
class: ImageTool,
config: {
endpoints: {
byFile: 'http://localhost:8008/uploadFile', // Your backend file uploader endpoint
byUrl: 'http://localhost:8008/fetchUrl', // Your endpoint that provides uploading by Url
}
}
}
}
...
});
```

### Example 2:
```javascript
import ImageTool from '@editorjs/image';
var editor = EditorJS({
...
tools: {
...
image: {
class: ImageTool,
config: {
endpoints: {
byFile: 'http://localhost:8008/uploadFile', // Your backend file uploader endpoint
byUrl: 'http://localhost:8008/fetchUrl', // Your endpoint that provides uploading by Url
},
buttonContent: 'Select an image',
}
}
}
...
});
```

## Temporary Solution:
A temporary fix is to include the SVG icon within the buttonContent property:
```javascript
import ImageTool from '@editorjs/image';
var editor = EditorJS({
...
tools: {
...
image: {
class: ImageTool,
config: {
endpoints: {
byFile: 'http://localhost:8008/uploadFile', // Your backend file uploader endpoint
byUrl: 'http://localhost:8008/fetchUrl', // Your endpoint that provides uploading by Url
},
buttonContent: ' Select an image',
}
}
}
...
});
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the ImageTool configuration and trace how buttonContent is rendered for the image selection button. Compare the default button with the custom-content case, then verify that setting buttonContent preserves the SVG icon alongside the supplied text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100