Opened 7 years ago

Last modified 6 years ago

#3409 reopened defect

Modifying tags causes text cursor (insert point) to move to start of text field.

Reported by: lakeyboy Owned by: Richard
Priority: minor Milestone:
Component: potlatch2 Version:
Keywords: Cc:

Description

I've come across an error which has the potential to accidently introduce incorrect information into the OSM database. When editing a tag text field of an existing object, attempting to insert new text anywhere within the existing text causes the text cursor to jump to the end of the text, causing what you're adding to the field to be added to the end and not where you intentionally placed the cursor. I hope i've explained this clearly enough! I'll elaborate if need be.

Attachments (1)

aaazzz trace.txt (2.1 KB) - added by stevage 7 years ago.
Some debug output demonstrating what goes on behind the scenes in this bug.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by stevage

  • Priority changed from major to minor

Confirmed. There is some seriously funky behaviour going on there. In particular, take this sequence of events:
1) Create a 'highway=zzz' tag, press enter (just to set a known starting state)
2) Enter the 'zzz' part, and move the cursor the start.
3) Press 'a' three times, producing "aaazzz".
4) On the third press, the cursor jumps to the end, as described in this bug report.

All kinds of bizarre stuff happens under the surface on the first three presses that is hidden due to code that tries to suppress it. For example, on the first press, the code thinks the drop down box has opened (it hasn't) and selected the first entry (bridleway). The second press and the zeroth behave "normally". The third, for reasons I don't yet understand, behaves as if you had just selected an entry from the drop down (which was never open): moving the cursor to the end is the correct behaviour in that case.

I'll attach a debug trace of the above.

Changed 7 years ago by stevage

Some debug output demonstrating what goes on behind the scenes in this bug.

comment:2 Changed 7 years ago by stevage

Another closely related undesirable behaviour is that when you enter short key values (seems to happen sometimes for lengths 0, 1, 2), you instead get the first value from the autocorrect lookup (ie, "bridleway" if the key is "highway"). Haven't narrowed down the cause yet.

comment:3 Changed 7 years ago by Richard

  • Owner changed from potlatch-dev@… to Richard
  • Status changed from new to accepted

There are known problems with the auto-complete component. There is no need to report further bugs with it, I'll be looking at it when I get a chance.

comment:4 Changed 7 years ago by stevage

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed in 24838.

comment:5 Changed 6 years ago by melb_guy

  • Resolution fixed deleted
  • Status changed from closed to reopened

This bug has unfortunately reappeared.

comment:6 Changed 6 years ago by melb_guy

  • Summary changed from Modifying tags causes text cursor (insert point) to move to end of text field. to Modifying tags causes text cursor (insert point) to move to start of text field.

I've just realised it does the opposite to what this bug was originally reported for. Replace the word "end" with "start" and that's what the new bug is.

Note: See TracTickets for help on using tickets.