form.reset() resets a form to whatever values were present when the form was loaded into the DOM. Instead, grab all the pertinent form bits and set there values to "clear". I don't think there's too much utility in putting this somewhere more general, but it could be something like DOM.clearForm(form) or something. Fixes T3629.
Details
Details
- Reviewers
epriestley - Maniphest Tasks
- Restricted Maniphest Task
- Commits
- Restricted Diffusion Commit
rP5729bbc085f2: Fix transaction comment bug
repro'd original issue
- open legalpad doc (or your favorite application transaction powered app)
- type in a comment but do not submit (you are creating a draft) e.g. "foo"
- reload page and note comment appears e.g. "foo"
- change comment e.g. "foobar"
- submit comment
- BUG - after submission, the comment reverts to the comment at initial page load e.g. "foo"
then after this patch, I can't repro it anymore with these steps - the comment is correctly blank
NOTE: this will need to be tested with more complicated forms.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
webroot/rsrc/js/application/transactions/behavior-transaction-list.js | ||
---|---|---|
135โ141 | This seems a tiny bit sketch to me (mostly the "select-one", which I think might be some kind of unusual magic), but we can clean it up when Differential/Maniphest start using it if there's an issue, since they actually have selects. |
webroot/rsrc/js/application/transactions/behavior-transaction-list.js | ||
---|---|---|
135โ141 | yeah, i was googling around for how to do this, thought this was basically crap, but read http://www.w3schools.com/jsref/prop_select_type.asp |
webroot/rsrc/js/application/transactions/behavior-transaction-list.js | ||
---|---|---|
142 | test |