[wp-trac] [WordPress Trac] #27491: Widget Customizer: Dynamically-created inputs cause from to replace itself without event to trigger re-initialization

WordPress Trac noreply at wordpress.org
Tue Apr 1 21:44:25 UTC 2014


#27491: Widget Customizer: Dynamically-created inputs cause from to replace itself
without event to trigger re-initialization
--------------------------+-------------------------
 Reporter:  westonruter   |       Owner:  ocean90
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  3.9
Component:  Widgets       |     Version:  trunk
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+-------------------------

Comment (by westonruter):

 Replying to [comment:14 ocean90]:
 > Without your patch it works as expected, but with the patch I first have
 to click the "Apply" to get the checkbox list.

 Without the patch, it works but poorly. What's actually happening is that
 when you change the `select`, it is submitting the form for sanitization.
 When the Ajax response returns, the inputs in the sanitized form are
 different than the inputs in the existing form (namely, the number of
 checkbox inputs have changed). Without the patch, the existing form was
 getting replaced with the sanitized form right away since the existing
 inputs could not be aligned with the sanitized inputs.

 Replacing the form right away when the inputs can't be aligned, however,
 is not a good experience and is what the patch seeks to avoid. If, for
 example, you start typing into a field and every input event causes the
 form fields to get replaced, then the user will lose a lot of the input
 they are entering. So this is why the Apply button is supposed to appear
 if it is determined that the sanitized form can't be synced without
 replacing the entire form: it forces the user to leave focus on any active
 element so that when the form does update, they don't lose anything they
 are inputting.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27491#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list