Closed
Bug 135019
Opened 24 years ago
Closed 13 years ago
Inline autocomplete: single backspace deletes only the suggestion, should also delete the last character typed
Categories
(Toolkit :: Autocomplete, defect)
Toolkit
Autocomplete
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: jruderman, Assigned: sshagarwal)
References
(Blocks 1 open bug)
Details
(Whiteboard: [good first bug])
Attachments
(1 file, 6 obsolete files)
|
1.33 KB,
patch
|
sshagarwal
:
review+
|
Details | Diff | Splinter Review |
I have to hit backspace twice to delete a character I just typed in an
autocomplete textbox (url bar, mail address widget). This is a regression of
bug 59534.
| Reporter | ||
Updated•24 years ago
|
Summary: Backspace after autocomplete does not delete last char typed → Inline autocomplete: backspace does not delete last char typed
| Reporter | ||
Comment 1•22 years ago
|
||
Same bug for Thunderbird: bug 239558
Comment 2•22 years ago
|
||
<applause> This is one of the major irritants about Mozilla Mail. It's
compounded by the fact that autocomplete takes so long to find the (often wrong)
address.
Suggestion: backspace in the address bar deletes the selected text plus one more
character. Would that work?
Gerv
| Reporter | ||
Comment 3•22 years ago
|
||
Right, pressing backspace should delete the selected (autocompleted) text plus
one more character.
Updated•22 years ago
|
Product: Core → Mozilla Application Suite
Updated•20 years ago
|
Comment 4•19 years ago
|
||
https://addons.mozilla.org/extensions/moreinfo.php?id=2300 may help as noted in bug 167708
Severity: normal → minor
OS: Windows 98 → All
Hardware: PC → All
(In reply to comment #3)
> Right, pressing backspace should delete the selected (autocompleted) text plus
> one more character.
Is this the right string to add my backspace problem Jesse? or shall I start a new one?
[problem] backspace key doing a function* other than removing entered text [/problem]
[*]similates alt+left arrow key function instead[/*]
| Reporter | ||
Comment 6•18 years ago
|
||
David, that's a totally separate problem.
Comment 8•18 years ago
|
||
Moving to MailNews Core per Mark Banner's request.
Component: Autocomplete → Composition
Product: SeaMonkey → MailNews Core
QA Contact: composition
Comment 10•14 years ago
|
||
I want to work on this bug. Can it be assigned to me?
Comment 12•14 years ago
|
||
Attachment #656388 -
Flags: review?(markcapella)
Comment 13•14 years ago
|
||
Comment on attachment 656388 [details] [diff] [review]
Please review the patch and point out the problems
I think I was added here by accident - tossing to module owner (correct me if I'm wrong) ...
Attachment #656388 -
Flags: review?(markcapella) → review?(mbanner)
Updated•14 years ago
|
Attachment #656388 -
Flags: review?(mbanner) → review?(neil)
Comment 14•14 years ago
|
||
Comment on attachment 656388 [details] [diff] [review]
Please review the patch and point out the problems
Well, I have to say that your idea works great in the the case that you want it to work for, so I'll award you f+. However, there are a number of issues:
>diff -r 50e4ff05741e toolkit/content/widgets/autocomplete.xml
This isn't actually the version used in Thunderbird's compose window. If you meant to change that version, it's xpfe/components/autocomplete/resources/content/autocomplete.xml (in which case some of my remaining comments may not apply).
>- this.mEnterEvent = aEvent;
>+ this.mEnterEvent = aEvent;
Spaces crept on to the end of this line. Please avoid trailing spaces.
> #ifdef XP_MACOSX
> case KeyEvent.DOM_VK_BACK_SPACE:
As you can see, the Mac already has some backspace handling, so your code would not work on the Mac.
>- cancel = this.mController.handleDelete();
>+ cancel = this.mController.handleDelete();
Some of the spaces got changed into a tab. Please avoid tabs.
>+ case KeyEvent.DOM_VK_BACK_SPACE:
The problem here is that you invoke this on any back space event.
Firstly, some platforms use Alt or Shift to change the meaning of back space.
Secondly, your code only works immediately after an autocomplete. If we're not actually autocompleting, then the code will incorrectly delete some text.
>+ var temp_uri = this.textValue;
There's no need to make a copy of temp_uri because it's only used once.
>+ this.textValue = temp_uri.substring(0,this.selectionStart);
Mozilla style is to have a space after the comma.
>-
Several blank lines seem to have inadvertently disappeared.
Attachment #656388 -
Flags: review?(neil) → feedback+
Comment 15•14 years ago
|
||
Attachment #657771 -
Flags: review?(mbanner)
Comment 16•14 years ago
|
||
Comment on attachment 657771 [details] [diff] [review]
patch v2
Neil's the best person to look at this.
Attachment #657771 -
Flags: review?(mbanner) → review?(neil)
Comment 17•14 years ago
|
||
(In reply to from comment #14)
These two comments do not seem to have been addressed:
> >+ case KeyEvent.DOM_VK_BACK_SPACE:
> The problem here is that you invoke this on any back space event.
> Firstly, some platforms use Alt or Shift to change the meaning of back space.
> Secondly, your code only works immediately after an autocomplete. If we're
> not actually autocompleting, then the code will incorrectly delete some text.
> >+ this.textValue = temp_uri.substring(0,this.selectionStart);
> Mozilla style is to have a space after the comma.
Comment 18•14 years ago
|
||
rb can you update the patch ?
Comment 19•13 years ago
|
||
Comment on attachment 657771 [details] [diff] [review]
patch v2
Was reviewed by Neil in comment 17, but the review comments have not been addressed by assignee (rahul123bhardwaj) yet.
Attachment #657771 -
Flags: review?(neil)
Comment 20•13 years ago
|
||
rahul123bhardwaj (aka rb), are you willing to complete your patch to address Neil's review comments of comment 16 (shortly after you filed your last wip patch)?
Flags: needinfo?(rahul123bhardwaj)
Updated•13 years ago
|
Summary: Inline autocomplete: backspace does not delete last char typed → Inline autocomplete: single backspace deletes only the suggestion, should also delete the last character typed
Comment 21•13 years ago
|
||
I am sorry, I would not be able to work on this patch. we can assign this bug to someone who is willing to look at it.
Flags: needinfo?(rahul123bhardwaj)
Updated•13 years ago
|
Assignee: rahul123bhardwaj → nobody
Updated•13 years ago
|
Status: ASSIGNED → NEW
Comment 22•13 years ago
|
||
This has a wip patch with review from Neil in comment 17, should be simple, probably just 10 lines of code or so.
Whiteboard: [good first bug][has wip patch][review comment 17]
| Assignee | ||
Comment 23•13 years ago
|
||
I have tried to take care of the alt, ctrl and autocomplete (though not sure if this is the right way to check for autocompletion).
Attachment #656388 -
Attachment is obsolete: true
Attachment #788232 -
Flags: review?(neil)
Comment 24•13 years ago
|
||
(In reply to Suyash Agarwal from comment #23)
> I have tried to take care of the alt, ctrl
I actually said alt and shift but you're right to mention ctrl (and you misspelled alt in your patch).
> and autocomplete (though not sure if this is the right way to check for autocompletion).
No, this just checks whether autocomplete is enabled. Ideally you would detect whether the text in the widget had just been suggested and therefore that pressing backspace would normally delete the suggestion and you therefore want to delete it yourself so that backspace will also delete the last character typed. However I'm not sure that we currently provide an easy way to determine this, or at least, not all of this.
[On an unrelated note, autoFillInput, which is the method that actually adds the suggestion, manages to refer to the same value using no fewer than three different variable names. Sigh.]
| Assignee | ||
Comment 25•13 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #24)
> I actually said alt and shift but you're right to mention ctrl (and you
> misspelled alt in your patch).
Sorry, I will add shift too.
> No, this just checks whether autocomplete is enabled. Ideally you would
> detect whether the text in the widget had just been suggested and therefore
> that pressing backspace would normally delete the suggestion and you
> therefore want to delete it yourself so that backspace will also delete the
> last character typed.
then this should work, we are just making the length of suggestion to zero here, so if it(suggestion) isn't there then, that should not affect anything and so, the backspace will just be deleting a single character either way. Please correct me if I am making incorrect assumptions.
| Assignee | ||
Updated•13 years ago
|
Attachment #788232 -
Flags: feedback?(acelists)
Comment 26•13 years ago
|
||
Comment on attachment 788232 [details] [diff] [review]
Possible fix
Review of attachment 788232 [details] [diff] [review]:
-----------------------------------------------------------------
Yes, this seems to work in msg compose.
Attachment #788232 -
Flags: feedback?(acelists) → feedback+
| Assignee | ||
Comment 27•13 years ago
|
||
I have tried using this.mDefaultMatchFilled
As this is made true in autoFillInput() when the input is suggested.
Attachment #788232 -
Attachment is obsolete: true
Attachment #788232 -
Flags: review?(neil)
Attachment #790720 -
Flags: review?(neil)
Comment 28•13 years ago
|
||
Comment on attachment 790720 [details] [diff] [review]
Possible fix v2
Just some style nits:
> break;
>+ case KeyEvent.DOM_VK_BACK_SPACE:
Please leave a blank line before the case.
>+ if (this.mDefaultMatchFilled && !aEvent.ctrlKey &&
>+ !aEvent.altKey && !aEvent.shiftKey) {
I don't like the way this wraps, perhaps use:
if (!aEvent.ctrlKey && !aEvent.altKey && !aEvent.shiftKey &&
this.mDefaultMatchFilled) {
>+ this.value = this.value.substring(0, this.selectionStart);
[Could use this.currentSearchString perhaps?]
[Should we clear this.mDefaultMatchFilled]?
Attachment #790720 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 29•13 years ago
|
||
Using currentSearchString doesn't seem to work, I don't know why
I also tried setting this.currentSearchString = aValue; in method setTextValue() but no effect.
| Assignee | ||
Comment 30•13 years ago
|
||
So, should I carry over the review without making the currentSearchString change?
Flags: needinfo?(neil)
| Assignee | ||
Comment 31•13 years ago
|
||
Attachment #790720 -
Attachment is obsolete: true
| Assignee | ||
Comment 32•13 years ago
|
||
Please ignore the previous patch.
Assignee: nobody → syshagarwal
Attachment #790747 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
| Assignee | ||
Updated•13 years ago
|
Whiteboard: [good first bug][has wip patch][review comment 17] → [good first bug]
Comment 33•13 years ago
|
||
(In reply to Suyash Agarwal from comment #29)
> Using currentSearchString doesn't seem to work, I don't know why
> I also tried setting this.currentSearchString = aValue; in method
> setTextValue() but no effect.
Maybe I was unclear, I meant instead of this.value.substring(0, this.selectionStart)
Flags: needinfo?(neil)
| Assignee | ||
Comment 34•13 years ago
|
||
Ya, this works! :)
Carrying over review from Neil.
Attachment #657771 -
Attachment is obsolete: true
Attachment #790751 -
Attachment is obsolete: true
Attachment #790756 -
Flags: review+
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 35•13 years ago
|
||
Neil, should this bug be moved to some better component in Core/XPFE so that it is checked in to the proper tree?
Updated•13 years ago
|
Component: Composition → Autocomplete
Product: MailNews Core → Toolkit
Comment 36•13 years ago
|
||
Keywords: checkin-needed
Comment 37•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Comment 38•9 years ago
|
||
Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/78bb1e757a33
Inline autocomplete: single backspace deletes the last character typed along with the suggestion. r=Neil
You need to log in
before you can comment on or make changes to this bug.
Description
•