Sha256: e51909a093fad25e59459b15845c90bde2074f40bae611c90377d96713e646b1

Contents?: true

Size: 918 Bytes

Versions: 1

Compression:

Stored size: 918 Bytes

Contents

module Watir
  class TextField < Input
    include UserEditable

    NON_TEXT_TYPES = %w[file radio checkbox submit reset image button hidden range color]

    inherit_attributes_from Watir::TextArea
    remove_method :type # we want Input#type here, which was overriden by TextArea's attributes

    private

    def selector_string
      selector = @selector.dup
      selector[:type] = '(any text type)'
      selector[:tag_name] = "input or textarea"
      selector.inspect
    end
  end # TextField

  module Container
    def text_field(*args)
      TextField.new(self, extract_selector(args).merge(tag_name: "input"))
    end

    def text_fields(*args)
      TextFieldCollection.new(self, extract_selector(args).merge(tag_name: "input"))
    end
  end # Container

  class TextFieldCollection < InputCollection
    private

    def element_class
      TextField
    end
  end # TextFieldCollection
end # Watir

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-6.0.0.beta4 lib/watir/elements/text_field.rb