platform icon indicating copy to clipboard operation
platform copied to clipboard

Cannot type whitespace and newline in TextArea inside a Tab

Open gscaparrotti opened this issue 3 years ago • 4 comments

Describe the bug

When putting a TextArea inside a Tab, the latter in no longer able to receive whitespace and newline characters, because those keystrokes are intercepted by the latter, which uses these keys to navigate between different Tabs. This behaviour cannot be disabled, because it's not handled by an event listener in Java, but only in plain Javascript inside the browser.

Expected-behavior

No response

Reproduction

  • Create a Vaadin Tab
  • Put a TextArea inside it
  • Try to type a whitespace or a newline character: nothing happens
  • Try to type a "normal" letter: it appears correctly inside the TextArea

System Info

Windows 11 Pro 21H2, Vaadin 14.5.5, Spring Boot 2.5.1

gscaparrotti avatar Feb 01 '22 08:02 gscaparrotti

Thanks for using Vaadin! We appreciate your help and we’ll take care of this as soon as possible.

vaadin-bot avatar Feb 01 '22 08:02 vaadin-bot

Typically you do not want to put a TextArea inside a Tab because a Tab is just the tab component, not a tabsheet. Are you looking for a tabsheet or do you really want to put a textarea inside the tab?

Artur- avatar Feb 01 '22 11:02 Artur-

There is TabSheet component in the Directory https://vaadin.com/directory/component/tabsheet

TatuLund avatar Feb 01 '22 11:02 TatuLund

Typically you do not want to put a TextArea inside a Tab because a Tab is just the tab component, not a tabsheet. Are you looking for a tabsheet or do you really want to put a textarea inside the tab?

Sorry for the ignorance, but I don't know what the difference between a Tab and a tabsheet is.

Looking at the official documentation, it looks like I am using the component the way it is meant to be used (in the official example, each Tab only contains a Paragraph, but the principle is the same).

In fact, there would be nothing wrong with my arrangement, aside from the inability to type certain characters inside the TextArea (I also have other components inside the same Tab which work totally fine).

gscaparrotti avatar Feb 01 '22 11:02 gscaparrotti