lib/under_os/ui/select.rb in under-os-1.1.0 vs lib/under_os/ui/select.rb in under-os-1.2.0

- old
+ new

@@ -1,17 +1,14 @@ -class UnderOs::UI::Select < UnderOs::UI::View +class UnderOs::UI::Select < UnderOs::UI::Input wraps UIPickerView, tag: :select def initialize(options={}) super self.options = options.delete(:options) if options[:options] - self.value = options.delete(:value) if options[:value] + @_.showsSelectionIndicator = true if options[:lense] - #@_.showsSelectionIndicator = true if options[:lense] - - @_.delegate = self @_.dataSource = self end def optgroups @optgroups ||= [{}] @@ -42,10 +39,10 @@ end def value=(value) prev_val = @value @value = Array(value).map(&:to_s) - emit :change if @value != prev_val + handle_change if @value != prev_val @value.each_with_index do |value, group| i = 0; optgroups[group].each do |v, label| if value == v