-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
BUG: Problem when dragging component composed by image and link #5049
Comments
Use the // Remove runCommand("open-assets"); as it doesn't make sense to run it on the model side
// you can activate the component via blocks (https://grapesjs.com/docs/api/block.html#properties)
// by using `activate` property
init(){
editor.runCommand("open-assets");
}
// Handle assets update in the view
view: {
events: {
dblclick: 'onActive',
},
onActive() {
const { model } = this;
editor.Assets.open({
select(asset, complete) {
const image = model.findType('image')[0];
if (image) {
image.addAttributes({ src: asset.getSrc() });
complete && editor.Assets.close();
}
}
});
}
} |
Hi! Check the prints: Then the view code: Adding a column and moving the component into: Here is the updated jsFiddle: https://jsfiddle.net/5er1kmg4/7/ But if you check the image model right after selecting the new image it has the new |
@gustavohleal my bad, you have to update the |
GrapesJS version
What browser are you using?
Brave last version
Reproducible demo link
https://jsfiddle.net/rp7oc96v/1/
Describe the bug
Hi Arthur!
I'm creating a new component, an image inside a link, like the
mj-image
component, but i'm stuck in one configuration or it's a bug...How to reproduce the bug?
What is the expected behavior?
What is the current behavior?
data-gjs-selectable="false"
we will move only the image instead of moving the whole component.Other problems i found
In my component, i have configured this:
So, when i drop my new component, the resizer shows up, but, if i click again, with the resizer visible, it hides...
If i put
data-gjs-locked="true"
ordata-gjs-editabble="false"
to block everything from image, i can't change it's src with assets manager.If I put the style
pointer-events:none
, the eventdblclick
from component don't fires, the grapesjs keeps clicking on the image 😔Also, tried the things we found in these issues: #3014 #2103
Code of Conduct
The text was updated successfully, but these errors were encountered: