Giter VIP home page Giter VIP logo

Comments (5)

TarekRaafat avatar TarekRaafat commented on May 10, 2024 1

Good point, actually what's special about it is that placeholder renders after autoComplete.js engine fires up and data gets loaded, and if you checked the demo I used that to have a preloading placeholder and after the data fully loads the new placeholder overwrites it which acts as an indicator that autoComplete.js is ready to be used or not incase of any error.

Still developers could still set the placeholder in their html as you mentioned or even by js by bypassing the placeholder config because it's not required.

from autocomplete.js.

mikob avatar mikob commented on May 10, 2024 1

Actually the way it stands the js placeholder code overwrites any placeholder set in the html even if you don't use the setting. I think it's best to just remove it as it's unnecessary.

from autocomplete.js.

TarekRaafat avatar TarekRaafat commented on May 10, 2024

That's true just checked and it does overwrite any placeholder which is not proper, I will fix it in order not to do so.

autoComplete.js is a "Use Case Design Driven" so every function has a use case and a reason behind it, that's why I have to find a good reason or more common use case to remove it. I understand that you find it necessary but others might do, fixing it will allow you to just neglect it without worrying about it.

from autocomplete.js.

mikob avatar mikob commented on May 10, 2024

@TarekRaafat I think it's best to keep a design minimal, personally. Since placeholder is just one of many attributes of a text input, why stop there? Why not add settings for maxlength, required etc. ? Since the attribute is just a 1:1 mapping, I think it's best not to include it at all. Actually, having it confused me because I was unsure whether my placeholder set in the html would still work (and it will likely confuse others).

Since calling ele.placeholder has exactly the same effect (even working the same way internally). There should be no use case that is not covered by doing the placeholder outside of it.

FWIW, this popular existing library doesn't include placeholder either: https://goodies.pixabay.com/javascript/auto-complete/demo.html

from autocomplete.js.

TarekRaafat avatar TarekRaafat commented on May 10, 2024

@mikob check v2.1.0 just released and it has fixed the placeholder overwriting bug.
You have a valid point about removing the placeholder, will consider it.

from autocomplete.js.

Related Issues (20)

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.