question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug in Autocomplete When certain characters are inserted (try ] or [)

See original GitHub issue

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • Framework7 Version: v1.5.2.

  • Platform and Target: Android and IOS.

If you try to input only a single character such as ] in the input field of autocomplete, an error will occur (console shows the error below).

Uncaught SyntaxError: Invalid regular expression: /([)/: Unterminated character class at new RegExp (<anonymous>) at framework7.js:8987 at Object.source (autocomplete.html:152) at HTMLInputElement.a (framework7.js:8982)

This issue is probably related to https://github.com/nolimits4web/Framework7/issues/1259 Framework7 attempts to highlight the inputted characters in all the items of the autocomplete dropdown menu items. Certain characters cause an issue with regex expression used for highlighting.

It would be nice to give the users the option of disabling the highlighting altogether as it is really useless in certain languages where characters take different shapes when they are inside words than when they are outside.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
seme1commented, Dec 28, 2016

That’s great. However, the regex line causing the error reported in this issue is still being executed even when highlightMatches is set to false. It would be nice to have Framework7 escape the string or avoids the declaration of the following line when highlightMatches is set to false.

var regExp = new RegExp('('+query+')', 'i');

0reactions
lock[bot]commented, Jun 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autocomplete is inserting selection after typing period #70176
Original Bug Report​​ Autocomplete is inserting the selected suggestion after the user types a period. This is not mentioned in the User Guide, ......
Read more >
intellisense autocomplete wrong completion
Sometimes, when writing repetitive, similar but not identical lines, the autocomplete feature makes a wrong assumption and completes a variable name using ...
Read more >
Autocomplete in entry with existing value after an insertion is ...
The most basic workaround for that is to check that the text being actually deleted is one character long; if not, it's probably...
Read more >
[content assist] Allow to disable auto insertion trigger characters
If someone wants to offer an option to disable ';' as auto-insertion character > then I'm fine with that. time pending, it is...
Read more >
Auto-Complete may not work - Office | Microsoft Learn
Cause. In Microsoft Excel, the Auto-Complete feature may not fill in the remaining characters if the algorithm that Excel uses detects a header...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found