cambridgeweblab / common-ui

A collection of common web components
MIT License
2 stars 2 forks source link

Empty <form> should not appear temporarily while waiting for schema from network #28

Open nealeu opened 7 years ago

nealeu commented 7 years ago

In ca-form, there is the following code in createdCallback, which causes the

element to be shown as an empty box until the first this.render() after schema load

this.form = createElementLegacy(this, 'form', { action: '', method: 'post', novalidate: 'novalidate' });

// hook form submit event
this.form.onsubmit = (e) => {
    cancelEvent(e);
  this.save();
};

This is annoying for testing and is visually annoying for the user.  

If we move it to render, then we can conditionally do it once by testing this.form == null first.

Better would be to show a loading animation while there is a pending network operation on.