Turn off multiple selection on ereader browsers

For different reasons, setting multiple="multiple" on <select> tags
doesn't work on Kobo and Kindle browsers.

On Kobo:

    * the <option> tags don't appear
    * the <option> tags in other <select> tags also don't appear
    * the labels on the other form elements get offset

On Kindle:

    * the full set of <option> tags don't appear, and the <select>
      won't scroll to show them
This commit is contained in:
Mike Colagrosso 2023-03-11 22:49:55 -07:00 committed by Alex Cabal
parent e48ac5643a
commit 4486a1e38d

View file

@ -3,7 +3,7 @@ $allSelected = sizeof($tags) == 0 || in_array('all', $tags);
?>
<form action="/ebooks" method="get" rel="search">
<label class="tags">Subjects
<select multiple="multiple" name="tags[]" size="1">
<select <? if(!Template::IsEreaderBrowser()){ ?> multiple="multiple"<? } ?> name="tags[]" size="1">
<option value="all">All</option>
<? foreach(Library::GetTags() as $tag){ ?>
<option value="<?= $tag->UrlName ?>"<? if(!$allSelected && in_array($tag->UrlName, $tags)){ ?> selected="selected"<? } ?>><?= Formatter::ToPlainText($tag->Name) ?></option>