Code Monkey home page Code Monkey logo

semanticforms's Introduction

semanticforms's People

Contributors

autre31415 avatar awidener3 avatar kethinov avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

semanticforms's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

npm
package.json
  • less 4.1.3
  • standard 17.1.0

  • Check this box to trigger a request for Renovate to run again on this repository

checkbox error

Given:

<form id="" action='/somewhere' method='post' class='semanticForms' data-clearfield-horizontal-offset='25' data-clearfield-vertical-offset='5'>
  <fieldset>
    <dl>
      <dt>
        <label for='statusReportedInput'>Status Reported</label>
      </dt>
      <dd>
        <input id='statusReportedInput' name='statusReportedInput' type='checkbox'>
      </dd>
    </dl>
    <input type='submit' name='submit' id='save' value='Save'>
    <input type='submit' name='cancel' id='cancel' value='Cancel'>
  </fieldset>
</form>

The following error is produced:
DOMException: Failed to execute 'querySelector' on 'Document': 'label[data-for=]' is not a valid selector.

Originating from line 59 of semanticforms.js

Optional secondary label

I'd love to have a discussion to what a good UI pattern would look like to display the accepted pattern in a form element.

We could try and fit it next to the floating label assuming the label wasn't too long.

Restrict JS events to target elements within semanticForms class form elements

At present, these JS events could stand to be a bit more defensive.

It would be preferable to return false on them immediately if the target element is not within a form element of class semanticForms. That restriction will prevent the events from firing in a context where they're not needed.

In the original version of this project, those events were just attached directly to the input elements that needed them, but this turned out to be inadequate because if you added more form elements to the DOM after this library's JS executes, the newly added form elements wouldn't get the JS events.

Adding a global event listener to the body tag itself solves that problem, but introduces the problem of needing to make sure the event is defensive enough to not fire when not needed.

Returning false if the target element is not within a form element of class semanticForms should help, but I am certainly open to other suggestions as well.

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.