<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Editing fragment causes running of javascript on every keyup</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113891475" />
  <subtitle>Editing fragment causes running of javascript on every keyup</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113891475</id>
  <updated>2026-08-02T07:29:30Z</updated>
  <dc:date>2026-08-02T07:29:30Z</dc:date>
  <entry>
    <title>RE: Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114393424" />
    <author>
      <name>Lee Jordan</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114393424</id>
    <updated>2019-07-23T14:43:56Z</updated>
    <published>2019-07-23T14:43:56Z</published>
    <summary type="html">I completely agree  with you Christoph, if there are ajax calls going on having that run on every key stroke could cause extra HTTP requests and could bomb some API calls for spamming. Also if I make a syntax error it could bomb the application right? I mean not just the fragment but could cause DXP to bomb out. I admit even I can create infinite loops, having the code just execute could cause instability.&lt;br /&gt;&lt;br /&gt;We haven&amp;#39;t looked at fragments in detail in terms of how we could use it, perhaps our first use case would be to live edit web content (which should be done in at least basic web content displays without fragments anyway).</summary>
    <dc:creator>Lee Jordan</dc:creator>
    <dc:date>2019-07-23T14:43:56Z</dc:date>
  </entry>
  <entry>
    <title>RE: Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114386506" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114386506</id>
    <updated>2019-07-23T06:14:44Z</updated>
    <published>2019-07-23T06:14:44Z</published>
    <summary type="html">Well, we haven&amp;#39;t really started created fragments for now, so I have no real world experience so far. And we will probably never use the online editor anyway, so I am not very invested into this. &lt;br /&gt;But I generally dislike automatically running javascript when I am developing. For us javascript is usually just this:&lt;br /&gt;initComponent(divId);&lt;br /&gt;Such a component can be anything, often it is e.g. a carousel.  We also load data from the backend quite often. Every keystroke would do backend calls. I am not sure, if that&amp;#39;s a good idea.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-07-23T06:14:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114385158" />
    <author>
      <name>Lee Jordan</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114385158</id>
    <updated>2019-07-22T20:25:23Z</updated>
    <published>2019-07-22T20:25:23Z</published>
    <summary type="html">The problem really is the javascript runs upon editing the HTML or CSS. I know this one is really basic, but shows how annoying it could be. I think the CSS &amp;#34;auto running&amp;#34; is really neat, the HTML auto running could get a little sketchy though if it&amp;#39;s running on incomplete syntax.&lt;br /&gt;&lt;br /&gt;How about run / autorun in like a button drop down. Use the button to run code and the dropdown to turn autorun on/off? If that&amp;#39;s still no go, could it only auto run the type of code you&amp;#39;re currently editing? That way then the javascript isn&amp;#39;t run when editing the HTML.</summary>
    <dc:creator>Lee Jordan</dc:creator>
    <dc:date>2019-07-22T20:25:23Z</dc:date>
  </entry>
  <entry>
    <title>RE: Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114385629" />
    <author>
      <name>Jorge Ferrer</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114385629</id>
    <updated>2019-07-22T20:18:40Z</updated>
    <published>2019-07-22T20:18:40Z</published>
    <summary type="html">Hey Lee, Christoph,Thanks once again for your feedback.We would prefer to avoid having a run button if possible. Would you mind sharing some real fragments that showcase how the current behavior is annoying?Also, we have been working on a feature to provide previews while working on a desktop environment of your framework of choice. It would be great if you could take a master snapshot and give us your feedback. It will most probably be included in SP1 and later GA2.</summary>
    <dc:creator>Jorge Ferrer</dc:creator>
    <dc:date>2019-07-22T20:18:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114384178" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114384178</id>
    <updated>2019-07-22T19:50:15Z</updated>
    <published>2019-07-22T19:50:15Z</published>
    <summary type="html">I agree with Lee Jordan.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-07-22T19:50:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114383888" />
    <author>
      <name>Lee Jordan</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114383888</id>
    <updated>2019-07-22T18:59:47Z</updated>
    <published>2019-07-22T18:59:47Z</published>
    <summary type="html">Yes!Have a run button instead.</summary>
    <dc:creator>Lee Jordan</dc:creator>
    <dc:date>2019-07-22T18:59:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113906437" />
    <author>
      <name>Pablo Molina</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113906437</id>
    <updated>2019-06-05T12:38:38Z</updated>
    <published>2019-06-05T12:38:38Z</published>
    <summary type="html">We were generating a preview on every keystore to allow seeing the actual result without the need of pressing any button. It&amp;amp;#39;s true that we are executing JavaScript everytime you change fragment&amp;amp;#39;s content, but with a less-blocking JavaScript this shouldn&amp;amp;#39;t be so annoying. Do you feel like we should disable realtime preview?</summary>
    <dc:creator>Pablo Molina</dc:creator>
    <dc:date>2019-06-05T12:38:38Z</dc:date>
  </entry>
  <entry>
    <title>Editing fragment causes running of javascript on every keyup</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113891474" />
    <author>
      <name>Lee Jordan</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113891474</id>
    <updated>2019-06-04T19:03:18Z</updated>
    <published>2019-06-04T19:03:18Z</published>
    <summary type="html">Editing experience is currently a little limited because existing javascript in the fragment is run on event change. Could there be a run button?</summary>
    <dc:creator>Lee Jordan</dc:creator>
    <dc:date>2019-06-04T19:03:18Z</dc:date>
  </entry>
</feed>
