our @EXPORT_OK = qw(
button_tag
input_tag
+ textarea_tag
date_tag
submit_tag
icon
);
}
+sub textarea_tag {
+ my ($name, $value, %attributes) = @_;
+
+ _set_id_attribute(\%attributes, $attributes{name});
+
+ my $class = delete $attributes{class};
+ my $icon = $attributes{icon}
+ ? icon(delete $attributes{icon}, class => 'prefix')
+ : '';
+
+ my $label = $attributes{label}
+ ? html_tag('label', delete $attributes{label}, for => $attributes{id})
+ : '';
+
+ html_tag('div',
+ $icon .
+ html_tag('textarea', $value, class => 'materialize-textarea', %attributes, name => $name) .
+ $label,
+ class => [ grep $_, $class, INPUT_FIELD ],
+ );
+}
+
sub date_tag {
my ($name, $value, %attributes) = @_;
: '';
my $label = $attributes{label}
- ? html_tag('label', delete $attributes{label}, for => $attributes{id})
+ ? html_tag('label', delete $attributes{label}, for => $attributes{id}, class => 'active')
: '';
- my $select_html = SL::Presenter::Tag::select_tag($name, $collection, %attributes);
+ my $select_html = SL::Presenter::Tag::select_tag($name, $collection, %attributes,
+ class => 'browser-default');
html_tag('div',
$icon . $select_html . $label,
=back
-=head1 BUGS
+=head1 BUGS & ISSUES
+
+There is a bug in MaterializeCSS, when using a Materialize select element on an iphone,
+the wrong element is selected. This is currently worked around in the presenter by using
+the 'browser-default' class on the select element as well as the 'active' class on the
+label (to prevent the label from overlapping the select element).
+This should be fixed, upstream, in MaterializeCSS. However it seems that the project is
+not maintained anymore (according to github issues[^1]). There is a community fork[^2],
+which it's still maintained and where the problem seems to be fixed already. It is currently
+in alpha V. 2.0.3-alpha. Maybe it would be good to consider switching to that fork at some
+point.
-Nothing here yet.
+[1]: e.g. https://github.com/Dogfalo/materialize/issues/6688
+[2]: https://github.com/materializecss/materialize
=head1 AUTHOR