[go: up one dir, main page]

Page MenuHomePhabricator

TextArea: resizing textarea is unsupported in iOS
Closed, DeclinedPublic

Description

Overview

The grabber/resize tool is not supported in Safari iOS and Chrome iOS for Codex: TextArea and OOUI: MultilineTextInputWidget. Currently, the grabber tool is not present on iPhone and iPad devices.

Background

The Codex TextArea component uses the CSS resize property in two scenarios.

  • resize: vertical
  • resize: none

By default, the TextArea is autosize=false which applies the resize: vertical style and allows the users to manually resize the <textarea> vertically. Currently, this resize feature is not supported in iOS.

When the TextArea is autosize=true, the resize/grabber tool is not present. Therefore users cannot manually resize the <textarea>. When autosize is true, the <textarea> will automatically grow in height based on the content inside the <textarea>.

  • Since resize isn't supported in iOS, we luck out because the resize tool is not present in the UI. The autosize feature works well in iOS and the resizing isn't needed here.
  • In macOS, we removed the resize tool with CSS resize = none
TextArea with grabber/resizer

Screenshot 2023-06-05 at 9.37.08 AM.png (524×763 px, 30 KB)

grabber tool.png (570×709 px, 40 KB)

TextArea without grabber/resizer aka autosize= true

Screenshot 2023-06-05 at 9.37.25 AM.png (502×713 px, 30 KB)

Known Issues

  • CSS resize property is not supported by Safari on iOS 10.0-10.2, 10.3, 11.0-11.2, 11.3-11.4, 12.0-12.1, 12.2-12.5, 13.0-13.1, 13.2, 13.3, 13.4-13.7, 14.0-14.4, 14.5-14.8, 15.0-15. 1, 15.2-15.3, 15.4, 15.5 (ref: see image)

    CSS-resize_not_supported.png (271×572 px, 50 KB)
  • CSS resize property is not supported by Chrome iOS
  • Known devices affected are iPhone & iPad
  • CSS selector -webkit-resizer is non-standard and should not be used without careful consideration. (ref: caniuse)
    • According to MDN, -webkit-resizer is non-standard and recommends checking cross-browser support before use. (ref: MDN)

      Screenshot 2023-06-05 at 9.06.57 AM.png (1×1 px, 167 KB)
  • Resize tool is not displayed in Safari iOS mobile devices. I used Xcode Simulator for these images:
    • iPhone SE (2nd generation) - iOS 14.0
      Simulator Screenshot - iPhone SE (2nd generation) - 2023-06-07 at 12.07.42.png (1×750 px, 150 KB)
    • iPhone 14 Pro Max - iOS 16.4
      Simulator Screenshot - iPhone 14 Pro Max - 2023-06-07 at 12.07.44.png (2×1 px, 437 KB)

Potential Approaches & Workarounds

  • Document that resize is not supported in iOS so our users are aware of this behavior in iOS devices.
  • Create a custom resizable textarea with its own custom resize tool. Inspired by this ref
    • Use mouse event listeners to track the user's interaction and update the size of the textarea.
    • To create a custom grabber tool, we'd need to design an icon and properly align it to the textarea.
    • Imitate the CSS resize tool's cursor style by using the CSS cursor property
      • cursor: ns-resize for resize vertical
    • Explore & test that this approach is supported across browsers.

Research

Are other component libraries and design systems supporting resize for iOS?

Resources

  • Xcode Simulator to check iOS devices and different iOS versions

Questions

  1. What's the best approach or workaround to implement support for the resize feature of TextArea for iPhone & iPad users?
  1. What tools can I use to check browser support for Android devices?

Event Timeline

lwatson renamed this task from TextArea: Add browser support for CSS resize to TextArea: Test browser support for CSS resize.May 31 2023, 7:14 PM
lwatson updated the task description. (Show Details)
lwatson renamed this task from TextArea: Test browser support for CSS resize to TextArea: Test cross-browser support for CSS resize in Safari iOS.Jun 7 2023, 4:18 PM
lwatson updated the task description. (Show Details)
lwatson updated the task description. (Show Details)
lwatson renamed this task from TextArea: Test cross-browser support for CSS resize in Safari iOS to TextArea: Test browser support for CSS resize in Safari iOS.Jun 7 2023, 8:07 PM
lwatson renamed this task from TextArea: Test browser support for CSS resize in Safari iOS to TextArea: browser support for CSS resize in Safari iOS.Jun 9 2023, 12:58 PM
lwatson renamed this task from TextArea: browser support for CSS resize in Safari iOS to TextArea: browser does not support CSS resize.
lwatson updated the task description. (Show Details)
lwatson renamed this task from TextArea: browser does not support CSS resize to TextArea: iOS does not support CSS resize.Jun 9 2023, 5:08 PM
lwatson renamed this task from TextArea: iOS does not support CSS resize to TextArea: iOS browser does not support CSS resize.
lwatson updated the task description. (Show Details)

Given that this is already unsupported in OOUI, I would lean towards declining this task for now. I couldn't find anything on why it isn't supported by Apple, but I'd guess it might have something to do with the fact that even when used on a supported mobile browsers, interfacing with a textarea grabber is unintuitive and I don't see it as a pattern we would actively encourage when the anticipated input method is touch. In my opinion, we should add a warning to the docs and provide guidelines that highlights not relying on the user manually resizing the textarea when optimizing for mobile experiences.

I'm curious to get input from design here though (cc @bmartinezcalvo @RHo).

@CCiufo-WMF I agree that we can note this behavior in the Codex docs for now.

lwatson renamed this task from TextArea: iOS browser does not support CSS resize to TextArea: resizing textarea is unsupported in iOS.Jun 12 2023, 12:52 PM
lwatson updated the task description. (Show Details)

Given that this is already unsupported in OOUI, I would lean towards declining this task for now. I couldn't find anything on why it isn't supported by Apple, but I'd guess it might have something to do with the fact that even when used on a supported mobile browsers, interfacing with a textarea grabber is unintuitive and I don't see it as a pattern we would actively encourage when the anticipated input method is touch. In my opinion, we should add a warning to the docs and provide guidelines that highlights not relying on the user manually resizing the textarea when optimizing for mobile experiences.

I'm curious to get input from design here though (cc @bmartinezcalvo @RHo).

Agree this makes sense to note in documentation and make low prio for workarounds, seems like we would ideally want the default autosize action in mobile, and ideally by default the height is set to a reasonably expected number of rows of text for that text-area by default too.

@lwatson - about your question about what tools to test for Android devices similar, I would guess the best and free one is gonna be the emulator in Android Studio (equivalent to XCode simulator), but it is a bit of an investment in setup and storage space.