Ticket #549 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Display jumps back to start of input field after entering a letter

Reported by: jayfresh Owned by: jayfresh
Priority: minor Milestone: 2.4.1
Component: core Version:
Severity: low Keywords: option macro
Cc:

Description

If you use the option macro to display a text input box, and type into it past the end of the input box, the display jumps back to the start of the string.

This problem has been found to occur on Firefox 2 and Firefox 3 beta. This does not occur on Safari 2, nor on IE6.

Attached patch addresses the problem by setting a property on the element being typed into and when iterating through other input fields on the page only changes their value if they do not have this property set. This is a patch to config.macros.option.propagateOption.

Attachments

ticket549.patch Download (1.2 KB) - added by jayfresh 2 years ago.
Patch for ticket 549
ticket549_2.patch Download (1.1 KB) - added by jayfresh 2 years ago.
Second patch for 549

Change History

Changed 2 years ago by jayfresh

Patch for ticket 549

  Changed 2 years ago by jayfresh

  • owner changed from JeremyRuston to jayfresh
  • status changed from new to assigned

  Changed 2 years ago by jayfresh

Update: there is also a mod to config.macros.option.genericOnChange to pass the current element through to propagateOption.

in reply to: ↑ description   Changed 2 years ago by EricShulman

Replying to jayfresh:

Attached patch addresses the problem by setting a property on the element being typed into and when iterating through other input fields on the page only changes their value if they do not have this property set.

Passing the current element into propagateOption() makes sense, but I don't see anywhere that you *reset* the 'active' property on that element after processing the input. The result will be that, when the same option value is subsequently entered using a different input field, *any* field that was used previously to modify the value will still have an 'active' flag set on it, and will not be sync'ed as intended.

In any case, it's doesn't seem necessary to set the 'active' property at all. Instead, when looping through the nodes, simply compare the current node with the passed in element itself, like this:

if (opt==optNode && nodes[t]!=elem)

This achieves the same result (skipping over the current input element) while not setting an extra property that is 'left behind' afterwards.

  Changed 2 years ago by jayfresh

Absolutely right. Patch updated.

Changed 2 years ago by jayfresh

Second patch for 549

  Changed 2 years ago by MartinBudden

  • milestone set to 2.5

  Changed 2 years ago by MartinBudden

  • milestone changed from 2.5 to 2.4.1

  Changed 2 years ago by MartinBudden

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in changeset:5628

Note: See TracTickets for help on using tickets.