Events are not working properly on the release 0.15.3
Also, events like "blur", "focus", (bascially everything except "click") don't work in backbone events configuration (by that I mean view events in backbone: https://backbonejs.org/#View-events ). for example: if I attach a callback to a "focus" event , the callback is never called. But callbacks to the "click" events...
Read full answer below ↓Question
Hi,
The events mechanism seems have changed a lot since release 0.15x. For example, normally when we want to prevent the default button behavior, we will use "return false" at the end of the callback function, but this doesn't work anymore in this release (no matter what you return), I have to call "event.preventDefault()" manully. Another issue is that I can't use $.on to attach event listener. But using the pure JS method "addEventListener" is fine. I can't understand why but I believe this has something to do with the file "extender.js". It seems that you add something to deal with all events and there are some imperfection.
sincerely
Answers (3)
Also, events like "blur", "focus", (bascially everything except "click") don't work in backbone events configuration (by that I mean view events in backbone: https://backbonejs.org/#View-events ). for example: if I attach a callback to a "focus" event , the callback is never called. But callbacks to the "click" events can be called in response to the events , except "return false" seems useless.
Can you please provide live examples of what was working in previous versions and what it doesn't now?
Example 1:
events: {
'click button.gjs-load-doload': "doLoad",
...
},
doLoad(e) {
//as callback to a button click event, e.preventDefault() become necessary and can't be replaced
by return false
e.preventDefault();
...
// in the previous versions, only return false is enough to stop propagation and stop element default behaviour and there is no need to write e.preventDefault() manually
return false;
},
Example 2: When I try to attach event listeners, only callback to the click events can be called
events:{
/* click events are alright, the callback can be called */
"click .gjs-indicator-checkbox-holder": 'toggle',
'click .indicator-refresh-singleton':'refreshSingleton',
/* blur and focus never works
'blur .auto-refresh-interval-input':'updateInterval',
'focus .auto-refresh-interval-input':'focus'*/
},```
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3295
BUG (v0.16.41): Button component with draggable property is not working properly
Version: v0.16.41 Are you able to reproduce the bug from the demo? [ ] Yes [ ] No What is the expected behavior? When we have a button with...
Issue #2337
[BUG / QUESTION] Deleting default styles does not work
Hello, i'm trying to delete some of the default styles of the blocks. I wrote everything I changed in a plugin. I used this function to upd...
Issue #3457
Custom trait input not working
Hi @artf ! Version: 0.17.3 Are you able to reproduce the bug from the demo?[ ] Yes[x] No What is the expected behavior? The input is create...
Issue #3136
Create one more key in JSON
{ "type": "text", "status": "hovered", "content": "Insert your text here", "attributes": { "id": "ixx2" }, "activeOnRender": 0, "open": fal...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Tutorial
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline — both $69.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Tutorial
10 Mistakes When Building a Visual Editor (And How to Avoid Them)
Visual editors are powerful tools — they enable non-technical users to create websites, emails, landing pages, and applications without writing code
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.