Sha256: d1b666187ae3a1e264060794016fb6968d99332410998120c71a106e9699f5aa

Contents?: true

Size: 612 Bytes

Versions: 6

Compression:

Stored size: 612 Bytes

Contents

module SimpleForm
  module Components
    module HTML5
      def initialize(*)
        @html5 = false
      end

      def html5
        @html5 = true
        if has_required?
          input_html_options[:required] = true
          input_html_options[:'aria-required'] = true
        end
        nil
      end

      def html5?
        @html5
      end

      def has_required?
        # We need to check browser_validations because
        # some browsers are still checking required even
        # if novalidate was given.
        required_field? && SimpleForm.browser_validations
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
simple_form-3.0.4 lib/simple_form/components/html5.rb
simple_form-3.0.3 lib/simple_form/components/html5.rb
simple_form-3.0.2 lib/simple_form/components/html5.rb
simple_form-3.0.1 lib/simple_form/components/html5.rb
simple_form-3.0.0 lib/simple_form/components/html5.rb
simple_form-3.0.0.rc lib/simple_form/components/html5.rb