Commit 1bbcc6d6 authored by Robert Knight's avatar Robert Knight

Increase input font size for touch devices

This fixes an issue on smaller iOS devices (eg. iPhone) where the browser zooms
in when an input field with < 16px font size is tapped. This change ought to be
applied to the `Input` component in the pattern library, but until then, apply
it to input fields in the client.

This change was taken from the `MarkdownEditor` component.
parent a2289471
import { useElementShouldClose } from '@hypothesis/frontend-shared'; import { useElementShouldClose } from '@hypothesis/frontend-shared';
import { Input } from '@hypothesis/frontend-shared'; import { Input } from '@hypothesis/frontend-shared';
import classnames from 'classnames';
import { useRef, useState } from 'preact/hooks'; import { useRef, useState } from 'preact/hooks';
import { withServices } from '../service-context'; import { withServices } from '../service-context';
...@@ -277,6 +278,10 @@ function TagEditor({ ...@@ -277,6 +278,10 @@ function TagEditor({
aria-label="Add tags" aria-label="Add tags"
dir="auto" dir="auto"
role="combobox" role="combobox"
classes={classnames(
// Larger font on touch devices
'text-base touch:text-touch-base',
)}
/> />
<AutocompleteList <AutocompleteList
id={`${tagEditorId}-AutocompleteList`} id={`${tagEditorId}-AutocompleteList`}
......
...@@ -102,6 +102,7 @@ export default function SearchField({ ...@@ -102,6 +102,7 @@ export default function SearchField({
classes={classnames( classes={classnames(
'pl-8 pr-8', // Add padding so input does not overlap search/clear buttons. 'pl-8 pr-8', // Add padding so input does not overlap search/clear buttons.
'disabled:text-grey-6', // Dim text when input is disabled 'disabled:text-grey-6', // Dim text when input is disabled
'text-base touch:text-touch-base', // Larger font on touch devices
)} )}
data-testid="search-input" data-testid="search-input"
dir="auto" dir="auto"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment