question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Environment

Please provide as many details as you can:

  • Hosting type
    • Form.io
    • Local deployment
      • Version: 4.2.x
  • Formio.js version: 4.2.12
  • Frontend framework: NodeJS
  • Browser: Chrome
  • Browser version: Current

Steps to Reproduce

  1. Build a form with at least two elements
  2. Re-order the form elements
  3. Observe there is no change event, therefore; any form render cannot update to reflect changes.
  4. None the form [render, redraw, renderComponents, triggerChange] methods have any effect.

Expected behavior

change event should occur not just when adding a component but also when moving. There should be a working redraw or render method to call on the formio render or the triggerChange method should cause it to update.

Observed behavior

moving components do not trigger any observable events.

Example

Live example, and/or example code to help demonstrate the issue.

None the form [render, redraw, renderComponents, triggerChange] methods have any effect. The only work around I found was to set the form in a builder on render event handler.

        builder.on('render', function() {
          instance.form = builder.form;
        });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marcus-at-localhostcommented, Dec 3, 2019

@jhen1422 moving a component around emits addComponent but no change event.

EDIT: adding form.emit('change', form.form) emits change event

  form.on('addComponent', function(info, parent, path, index, isNew) {
    console.log('addComponent', info, parent, path, index, isNew);
    if(!isNew){
    	alert('Moved')
    }
	form.emit('change', form.form)
  });

https://jsfiddle.net/4a1ousy0/

0reactions
jhen1422commented, Dec 4, 2019

@marcus-at-localhost After discussion with the team, we have determined that the addComponent triggering in place of the change vent is expected behavior when moving components within the builder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug - Wiktionary
(entomology) An insect of the order Hemiptera (the “true bugs”). Any of various species of marine or freshwater crustaceans; e.g. a Moreton Bay...
Read more >
Bug Definition & Meaning - Merriam-Webster
The meaning of BUG is any of an order (Hemiptera and especially its suborder Heteroptera) of insects (such as an assassin bug or...
Read more >
Bug (2006) - IMDb
An unhinged war veteran holes up with a lonely woman in a spooky Oklahoma motel room. The line between reality and delusion is...
Read more >
Bug - Wikipedia
A terrestrial arthropod animal (with at least six legs). Insect, a six-legged arthropod · Covert listening device, used in surveillance, espionage and policing ......
Read more >
Bug Definition & Meaning - Dictionary.com
The word bug is often used to refer to tiny creatures that crawl along, such as insects and even small animals that are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found