taiga-family / taiga-ui

Angular UI Kit and components library for awesome people

Home Page:https://taiga-ui.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐞 - New `Textfield` with `<select tuiTextfield />` has incorrect behavior on IOS

nsbarsukov opened this issue · comments

Playground Link

https://taiga-ui.dev/next/components/textfield#dropdown

Description

  1. Open https://taiga-ui.dev/next/components/textfield#dropdown
  2. Click on the 2nd textfield

Desktop (MacOS):
Снимок экрана 2024-05-31 в 11 49 16

Mobile device (iPhone 13 mini, ios 17.2.1):

Angular version

16

Taiga UI version

main branch

Which browsers have you used?

  • Chrome
  • Firefox
  • Safari
  • Edge

Which operating systems have you used?

  • macOS
  • Windows
  • Linux
  • iOS
  • Android

There's (pointerdown.prevent) that prevents opening on desktop and Android, looks like it's not enough for iOS. Maybe try something like capture.stop on various pointer/mouse/touch/click events to see what helps.

Problem description

The main reason of it – programmatic focus.

'(pointerdown.prevent)': 'el.focus()',

(pointerdown.silent.prevent)="input.focus()"

It triggers appearance of native dropdown and this behavior cannot be cancelled!

Reproduction

<select></select>

<button>Focus select!</button>
const select = document.querySelector('select')!;
const button = document.querySelector('button')!;

button.addEventListener('click', () => {
  select.focus();
});