From 1a71dc6c8f323cef31eb006a8a6299b4dfe71332 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 8 Apr 2016 09:42:22 +0100 Subject: Filtered hints; ignore unmatched text. When the user is typing a link's text, any mistyped character exits link hints mode. This makes little sense. In practice, this usually happens because the user mis-typed something. Here, we ignore typed characters which do not match any hints. (Also, add a test for this.) --- tests/dom_tests/dom_tests.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee index 3977d046..96d95902 100644 --- a/tests/dom_tests/dom_tests.coffee +++ b/tests/dom_tests/dom_tests.coffee @@ -282,6 +282,18 @@ context "Filtered link hints", sendKeyboardEvent "A" assert.equal "1", hintMarkers[3].hintString + # This test is the same as above, but with an extra non-matching character. + should "narrow the hints and ignore typing mistakes", -> + hintMarkers = getHintMarkers() + sendKeyboardEvent "T" + sendKeyboardEvent "R" + sendKeyboardEvent "X" + assert.equal "none", hintMarkers[0].style.display + assert.equal "3", hintMarkers[1].hintString + assert.equal "", hintMarkers[1].style.display + sendKeyboardEvent "A" + assert.equal "1", hintMarkers[3].hintString + context "Image hints", setup -> -- cgit v1.2.3