DavidCain / mitoc-trips

The MIT Outing Club's trip management system
https://mitoc-trips.mit.edu
GNU General Public License v3.0
43 stars 9 forks source link

Odd text box behavior #12

Closed viccro closed 5 years ago

viccro commented 6 years ago

Noticed in "Medical history" and "Medicines" boxes, as well as "Notes" on trip sign-up pages:

There's a weird behavior where, if you start typing into the text box, then go back to insert text halfway through what you'd previously typed, only one character will be inserted correctly. Then the cursor will jump to the end of your input and continue typing.

For example, if the textbox was filled with abcde, and I tried to change that to ab123cde without deleting cde and retyping from the point of insertion, I would instead see ab1cde23 entered.

There's also a weird effect on deletion, midway through entered text.

jadrian commented 6 years ago

+1. To reproduce the deletion issue, write a line of text with multiple words in it. Then press backspace a bunch of times. Note that when you delete the last remaining letter from a word, you also delete the preceding space character.

DavidCain commented 6 years ago

Thanks for the report! I'll check this one out some time tomorrow.

DavidCain commented 6 years ago

Quick update: I'm able to reproduce both the issues you two are reporting. I suspect it's something to do with the library I'm using to make Django forms play nicely with Angular. I'll see if I can get to the bottom of it soon. In the meantime, thanks for letting me know!

DavidCain commented 5 years ago

Hey, Jadrian and Vicki. Just wanted to say that I'm sadly still aware of this bug - it still gives me trouble from time to time, even. I still suspect it has something to do with django-angular, which this project uses for a lot of widget logic.

At this point, I'm likely to pursue a React-based refactoring of the frontend. django-angular does not (yet) support Django 2.0, and AngularJS has been a legacy project for some time. MITOC Trips makes limited use of JavaScript widgets in the first place, and it's high time we introduce a proper frontend stack (ES6, etc.)

Thanks again for reporting this. I may try to dig into the issue in the near future, but I can't immediately figure out what's the root cause, and the refactor is somewhere on the near horizon (probably some time after WS 2019).

kylebarron commented 5 years ago

Just FYI, I also noticed this yesterday when creating a trip.

Browser: Chromium Version 69.0.3497.100 (Official Build) (64-bit), specifically "ungoogled-chromium"

DavidCain commented 5 years ago

Thanks, Kyle. Unless somebody else is really motivated to dig deep and uncover the source of this, I suspect it will remain an issue for the time being (until I do the necessary front-end refactor). Thanks for letting me know.