GithubHelp home page GithubHelp logo

tabcomplete's Introduction

tabcomplete's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tabcomplete's Issues

Expected behavior

When I put a in the first example, it shows afghanistan but when I press tab it shows anything but Afghanistan. The textarea works as expected

Is that to be expected?

Tab completion happens on Firefox when switching tab with keyboard, on textarea

This was noticed on The Lounge, which uses [email protected] (in case it's been solved since then), and now uses a textarea element.
Note that this bug was absent when using an input element.

See details and screencast of the bug in this issue: thelounge/thelounge#529.

So far a proposed fix has been made in thelounge/thelounge#541 by explicitly checking for !e.ctrlKey in the handler of the keydown.tabcomplete event. Is this an acceptable fix? From what I've looked, I couldn't find a better solution.

Case of entered text is not updated if "select" is used as hint

If the option hint is set to "select" then the case of the entered characters remains the same regardless of the case of the word it is being matched to.

My suggestion for a fix is to change this in line 144:

var text = options.hint == "select" ? value : [...]

To this:

var text = options.hint == "select" ? value.slice(0, -word.length) + word : [...]

Hint not clearing properly

When programmatically emptying the input field the hint is not cleared, causing this issue;

Here's a GIF demonstrating the issue.

  1. When typing something that does not exist in the filter array, pressing x (clearing) works as expected.
  2. When typing something that does exist in the filter array, pressing x does not hide the hint. From reading through the code quickly I'd assume this is because it only clears the hint on backspace keydowns.
  3. Hitting backspace to manually remove works as expected.

This is the on-click event for the x button

$clear.click(function(e) {
  e.preventDefault();
  $filter_by.val('').trigger('keyup').focus();
});

I've also tried

$clear.on('click', function(e) {
  e.preventDefault();
  var customEvent = $.Event('keydown');
  customEvent.which = 8 // Backspace key
  $filter_by.val('').trigger(customEvent).focus();
});

without success.

@erming, do you have any ideas how to solve this? I don't have time right now to properly read through this lib and do a PR :(.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.