Git Product home page Git Product logo

Comments (2)

rubenv avatar rubenv commented on August 17, 2024 1

can I make a PR with this improvement

Certainly! Always welcome!

from angular-select2.

andre-f-paggi avatar andre-f-paggi commented on August 17, 2024

Well, I discovered that the select2 directive does transfer the attributes to the internal input hidden field, even the required attribute.
The problem is that the HTML5 specification does not validate hidden fields.

I got what I wanted with these lines of code:

if(attrs.required){
   element[0].style = "display:visible; position:absolute; clip:rect(0,0,0,0);";
   element[0].type = "text";
}

But I don't know about HTML5 semantics, acessibility and I dont think it was an elegant solution. Because of that, I don't think that this may be useful for this project and maybe I will do this only on my company's project, because there is no rule there. 😁

I will study more about this difficulty and about this project's code.

Thanks for your time.

from angular-select2.

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.