Giter Site home page Giter Site logo

Comments (10)

azzamallow avatar azzamallow commented on July 23, 2024
  • 1 for this. Ive run into the exact same problem.

the "autocomplete" class on that div is specific enough to customise elements within, a way to add class on the input field would be much handier.

from allmighty-autocomplete.

JustGoscha avatar JustGoscha commented on July 23, 2024

Okay, maybe'it would be good if the class would be on both? On the input and the outer div

from allmighty-autocomplete.

chesleybrown avatar chesleybrown commented on July 23, 2024

That wouldn't make sense to me... couldn't you just target the input if the outer div had a class?

autocomplete > input

from allmighty-autocomplete.

azzamallow avatar azzamallow commented on July 23, 2024

@JustGoscha sounds fine.

@chesleybrown you can do that, the issue here is bootstrap has classes which we would like to apply to the input field

from allmighty-autocomplete.

davidmh avatar davidmh commented on July 23, 2024

@chesleybrown Yes, but it's not optimal.

This is DRY-er and stays synchronised with the styles in bootstrap:

<input class="form-control" ... />
<input class="form-control input-lg" ... />
<!--- N other custom inputs -->

Against this:

.autocomplete input {
  /* all the properties in .form-control */
}

.different .autocomplete input {
  /* overrides such as .input-lg */
}

/* N other customisations */
<input ... />
<input ... />
<!--- N other inputs -->

Which it's a bit harder to maintain and doesn't .


How about this?

<autocomplete
  attr-class="wrapper-class"
  attr-id="wrapper-id"
  attr-input-class="form-control input-lg"
  attr-input-id="input-id"
  ...
 ></autocomplete>

from allmighty-autocomplete.

azzamallow avatar azzamallow commented on July 23, 2024

@davidmh, @chesleybrown, @JustGoscha

The wrapping div already has 'autocomplete' on there as a class. Do you have an example where using attr-class on that wrapping div to add a second class is advantageous?

from allmighty-autocomplete.

davidmh avatar davidmh commented on July 23, 2024

Nop, it's just to make it backwards compatible. Maybe someone already deployed something using this directive.

Those attributes could be marked as deprecated to warn about future deletion or simply removed. They are not really relevant anymore.

Edit:
And attr-input- seems a bit more explicit.

from allmighty-autocomplete.

JustGoscha avatar JustGoscha commented on July 23, 2024

@davidmh Ok, let's do it, just make sure it's still optional an works without 😉
Also update the documentation in the README.md, whoever makes the change 😃

from allmighty-autocomplete.

azzamallow avatar azzamallow commented on July 23, 2024

I'm dependant on a fix so ill go ahead and do it

from allmighty-autocomplete.

azzamallow avatar azzamallow commented on July 23, 2024

See: #20

Once verified could you plus update the bower version so I cna start using it?

from allmighty-autocomplete.

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.