Autocomplete for HTMLTextAreaElement and more.

Overview

Textcomplete

Autocomplete for HTMLTextAreaElement and more.

Publish Test GitHub pages

Document.

Packages

Textcomplete consists of subpackages:

Name Description
@textcomplete/core Core of Textcomplete.
@textcomplete/textarea Editor for HTMLTextAreaElement.
@textcomplete/contenteditable Editor for contenteditable. (Experimental)
@textcomplete/codemirror Editor for CodeMirror. (Experimental)
@textcomplete/utils Utility functions for editors.

Development

View Document

yarn install
yarn lerna bootstrap
yarn docs

then open http://localhost:1234.

Release

yarn release

then create a release for the shown tag.

License

© Yuku Takahashi - This software is licensed under the MIT license.

Comments
  • CKEditor integration issue

    CKEditor integration issue

    Hi,

    I am writing a Drupal plugin to incorporate your textcomplete plugin. https://www.drupal.org/sandbox/adammitchell/2291661

    However I am having issues with the integration. CKEditor puts it's contenteditable inside an iframe so I had to slightly alter the plugin to use this.el.ownerDocument.getSelection().getRangeAt(0); instead of window.getSelection().getRangeAt(0);. After doing this I now get issues with CKEditor as I type. I wonder if you could help?

    The issue is IndexSizeError: Index or size is negative or greater than the allowed amount on line 371 of ckeditor.js

    Any insight into the issue would be greatly appreciated.

    enhancement DEPRECATED jquery-textcomplete 
    opened by munchell 15
  • Contenteditable - replace to insert html.

    Contenteditable - replace to insert html.

    How about having replace function to return something like this

    replace: function (word) { return '<span style="background: #BBBBBB;color: #FFFFFF;">' + word + '</span>' }

    It currently inserts as code and not as html element into content editable.

    DEPRECATED jquery-textcomplete 
    opened by andrejkaurin 12
  • Couldn't able to adjust height of Suggestion dropdown

    Couldn't able to adjust height of Suggestion dropdown

    I have implemented jquery-textcomplete plugin in my project but couldn't able to control the height of Suggestion dropdown. I want that the dropdown height should be adjusted according to its content and if content length exceeds the page height a scrollbar gets added automatically.

    Kindly have a look on below snapshot image

    bug DEPRECATED jquery-textcomplete 
    opened by dasguptahirak 9
  • Not working when loaded in <head>

    Not working when loaded in

    Textcomplete only seems to work if I require the library after the DOM loads. Note in both cases I'm calling $('textarea').textcomplete() after the DOM is loaded.

    Obviously the workaround is to just put the script before the closing body tag, but since I am a rails user, that makes using the asset pipeline a pain.

    works: https://gist.github.com/91639dc03efb09128197 doesn't work: https://gist.github.com/9b87f2121b7ea965299d

    When I load it at in the head I get lots of errors like:

    Uncaught TypeError: Cannot read property 'top' of undefined // because $activeEl is empty
    Uncaught TypeError: Cannot read property 'value' of undefined
    

    Shouldn't this work either way? Why is it dependent on the DOM being loaded on initialize.

    bug DEPRECATED jquery-textcomplete 
    opened by jmondo 9
  • "Words" not firing on empty textarea in sample

    This is an issue only with the example, and my regex is so bad I don't see the fix.

    If the sample textarea is empty, the Words (tech companies) will not match the regex and the dropdown will not fire. Adding a single space and then typing a company works correctly.

    I'm sure there's some regex for "starts with space OR text is blank", but I'm afraid I don't know it.

    Thanks to anyone who knows it, and fixes the demo.

    bug DEPRECATED jquery-textcomplete 
    opened by ScottWallace 9
  • Integration with CKEditor / TinyMCE

    Integration with CKEditor / TinyMCE

    I tried to integrate jquery-textcomplete with ckeditor, then I got this error. TypeError: CKEDITOR.instances.issue_notes is undefined Can you guise give me a little help to accomplish this. I will put the code sample bellow. You can quickly look at this. Thanks.

    This is jsfiddle : https://jsfiddle.net/btjapqkp/

    question DEPRECATED jquery-textcomplete 
    opened by namaljayathunga 8
  • .active element conflicts with Bootstrap

    .active element conflicts with Bootstrap

    The active <li> gets class="textcomplete-item active", but the .active class conflicts with Bootstrap styling. It should be changed to .textcomplete-item-active or something

    DEPRECATED jquery-textcomplete 
    opened by tomsommer 8
  • recognise spaces

    recognise spaces

    Currently i can type @ and it display my list of values which then highlight using the overlay when selected. What you cannot do is have a space in a value so "@My value" would only highlight "@my". I would like the whole value to highight and recognise the spaces.

    Does anyone know if this is possible?

    question DEPRECATED jquery-textcomplete 
    opened by martinlawuk 8
  • Contenteditables is not working

    Contenteditables is not working

    Hello ,

    Hope you are doing great,

    Your plugin is great but there is still one issue in your plugin

    your latest js is not working perfectly for ContentEditable example.

    So I have tried your old js for my requirement

    but it also create some issue.

    Example :

    in my editable div before searching using @ I have to write any one character then I also have to give space then search is working perfectly.

    but if I try directly start with @ then its not working perfectly.

    Please check it in ie9 and latest version of firefox.

    Please help me

    Thanks

    bug DEPRECATED jquery-textcomplete 
    opened by lakhanOpen 8
  • Replace only needed range in CodeMirror

    Replace only needed range in CodeMirror

    For https://github.com/yuku/textcomplete/issues/346

    • Added a method to SearchResult class to provide replacement data.
    • Using the above method, replace only needed range in CodeMirror.
    • In order not to change the interface of the SearchResult#replace, the information needed for replacement can be obtained with getReplacementData, which is used in SearchResult#replace and @textcomplete/codemirror.
    opened by phigasui 7
  • Attach textcomplete to the active CKEditor only

    Attach textcomplete to the active CKEditor only

    Prevent memory leaks in single page application environment, when multiple CKEditor instances are initialized an destroyed one after another (As if posting several comments using CKEditor in a popup screen).

    DEPRECATED jquery-textcomplete 
    opened by teodossidossev 7
  • Dropdown's height incorrectly calculated, dropdown placed offscreen

    Dropdown's height incorrectly calculated, dropdown placed offscreen

    Because the dropdown's height is calculated as this.items.length * cursorOffset.lineHeight (https://github.com/yuku/textcomplete/blob/main/packages/textcomplete-core/src/Dropdown.ts#L227) when a max-height is set on the dropdown element, it's height is incorrectly calculated. This means the dropdown will be placed offscreen in certain circumstances, especially when there are a lot of items.

    Could this.el.clientHeight be used instead?

    This dropdown can show up to 100 items:

    Screen Shot 2021-12-28 at 10 31 23 AM

    When I narrow the list down, it correctly displays on screen:

    Screen Shot 2021-12-28 at 10 45 13 AM
    opened by mgmeyers 0
  • Search result is replaced with `undefined` values

    Search result is replaced with `undefined` values

    Hey!

    Wanted to ask about potential bug and possible solution. It occurs when a search result that is being selected from textcomplete suggestions contains $0, $1 or any other number in similar pattern (which I guess represents regex substitution). Basically, what is happening, these substitution patterns are being replaced with empty strings or what is worse, with undefined string, probably because of the lines https://github.com/yuku/textcomplete/blob/main/packages/textcomplete-core/src/SearchResult.ts#L4 and https://github.com/yuku/textcomplete/blob/main/packages/textcomplete-core/src/SearchResult.ts#L24. I wonder what is the use case for that (like, how we can actually provide replacement groups, for example when search result that looks like fun$1() or VALUE$10). We could potentially try to escape these values somehow, but not sure if there's any callback that we can attach to to unescape them once they are parsed. Any suggestions highly appreciated!

    TLDR: Selecting a suggestion from a textcomplete that contains regex substitution returns oddly - like ab$5ab -> abundefinedab.

    opened by kbiedrzycki 1
  • Insert HTML

    Insert HTML

    Hi !

    I switched from jquery-textcomplete to the new version but I can no longer paste html content in my contenteditable div, it is automatically escaped.

    How can I solve my problem ?

    I guess the problem is in the ContenteditableEditor file (applySearchResult method) with insertText

    this.el.ownerDocument.execCommand(
        "insertText",
         false,
         replace[0] + replace[1]
    )
    
    question 
    opened by BaptisteVasseur 5
  • Using TextComplete from the browser/dist

    Using TextComplete from the browser/dist

    How can I use textcomplete on a text area from the browser by just including the JSS/CSS? I found the JS on a CDN, but only for the textcomplete JS, not for the code.

    opened by lvca 0
Releases(v0.1.12)
Owner
Yuku Takahashi
Software engineer at @hq-jp
Yuku Takahashi
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Autocomplete, diagnostics, hover info & more for the Wally package manager

Wally Utilities This VSCode extension provides some nice-to-haves when using the Wally package manager. The extension can be downloaded from the Visua

Filip Tibell 4 Jul 28, 2022
Obsidian plugin that adds autocomplete and auto-formatting to frontmatter tags.

Obsidian Front Matter Tag Wizard Tired of having to type # to get tag autocompletion in your Obsidian note front matter? I feel your pain. This plugin

Eric 10 Nov 5, 2022
Autocomplete für YForm Tabellen

?? WIP REDAXO-Addon: YForm Autocomplete Dieses Addon ermöglicht, Felder einer YForm-Tabelle über eine weitere automatisiert zu befüllen. Features Todo

Thorben 2 Jun 17, 2022
autocomplete/typeahead js plugin for bootstrap v5

bootstrap-5-autocomplete This is a rewrite of https://github.com/Honatas/bootstrap-4-autocomplete for bootstrap v5. Example const ac = new Autocomplet

Evgeny Zinoviev 76 Dec 28, 2022
Email Genie Allows autocomplete on email field by providing a list of domain suggestions (gmail.com, outlook.com, etc.).

Allows users to easily and quickly complete an email field by providing a list of domain suggestions (gmail.com, outlook.com, etc.). This package stands out for its flexibility, its compatibility with libraries / frameworks, but especially its use of basic HTML and Javascript functionalities that maximize the native behavior of desktop AND mobile browsers.

Simon Arnold 3 Oct 4, 2022
An autocomplete component, built to be accessible.

Accessible autocomplete The accessible autocomplete is a component that helps users choose answers from a list you provide. You can also use it to mak

Government Digital Service 771 Jan 4, 2023
Autocomplete component created with pure javascript

Pickle Complete Pickle complate is a autocomplate component written as completely pure javascript. Just send json object or request information have f

Kadir Barış Bozat 2 Jul 5, 2022
jQuery plugin for fuzzy search in autocomplete

fuzzycomplete jQuery plugin for fuzzy search in an autocomplete form, which uses Fuse.js. By harnessing the flexibility Fuse.js, this plugin allows yo

null 14 Nov 1, 2021
The world of cryptocurrencies is diverse and becoming more and more popular

We are providing an user with a simple learning resource for an intro into the CryptoCurrency World. Along with a community grown message board to assist with further learning.

null 3 Jun 20, 2022
fardin 8 Oct 18, 2022
A Leaderboard app that pulls from a LeaderboardGameAPI and allows users to view recent scores and add more scores to the score board. Built with HTML5, CSS, JavaScript, and Webpack.

Leaderboard A Leaderboard app that pulls from a LeaderboardGameAPI and allows users to view recent scores and add more scores to the score board. Buil

Steven Ntakirutimana 5 Dec 21, 2022
There can be more than Notion and Miro. Affine is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

AFFiNE.PRO The Next-Gen Knowledge Base to Replace Notion & Miro. Planning, Sorting and Creating all Together. Open-source, Privacy-First, and Free to

Toeverything 12.1k Jan 9, 2023
High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.

lazysizes lazysizes is a fast (jank-free), SEO-friendly and self-initializing lazyloader for images (including responsive images picture/srcset), ifra

Alexander Farkas 16.6k Jan 1, 2023
Shikhar 4 Oct 9, 2022
A personal semantic search engine capable of surfacing relevant bookmarks, journal entries, notes, blogs, contacts, and more, built on an efficient document embedding algorithm and Monocle's personal search index.

Revery ?? Revery is a semantic search engine that operates on my Monocle search index. While Revery lets me search through the same database of tens o

Linus Lee 215 Dec 30, 2022