question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default command is triggered inside text areas

See original GitHub issue

Summary

In Primefaces 7.0 (and latest), the default command is triggered even when inside a textarea. Adding a new line in the text area triggers the default command. The problem seems to be that the event target is incorrect. There is a check in place

$(e.target).is('textarea,button,input[type="submit"],a')

However, the target is not resolved to a textarea. In PF 6 this worked as expected and there was a change in forms.defaultcommand.js 7 months ago, fixing #4324.

1) Environment

  • PrimeFaces version: 7.0
  • Does not work in latest snapshot either
  • Affected browsers: Tested in Chrome, Firefox, IE

2) Expected behavior

The default command should not be triggered when inside a textarea.

3) Actual behavior

The default command is triggered when inside a text area.

4) Steps to reproduce

Create a textarea and a commandlink with default command. Try to add a new line in the textarea, the default command is triggered.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tandraschkocommented, Jul 11, 2019

@mertsincan as it was your change, would you like to check it?

0reactions
mellowarecommented, Aug 15, 2019

@mertsincan Debugging this it appears in this line…

if ($(e.target).is('textarea,button,input[type="submit"],a')) {

$(e.target) is the FORM and not the TEXTAREA.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add default value for html <textarea>? - Stack Overflow
Here is my jsFiddle example. this works fine: <textarea name='awesome'>Default value</textarea>.
Read more >
How to Use Text Areas (The Java™ Tutorials > Creating a GUI ...
Text areas are editable by default. The code setEditable(false) makes the text area uneditable. It is still selectable and the user can copy...
Read more >
The Textarea element - HTML: HyperText Markup Language
Default content entered between the opening and closing tags. <textarea> does not support the value attribute. The <textarea> element also ...
Read more >
HTML textarea tag - W3Schools
Attributes ; required, required, Specifies that a text area is required/must be filled out ; rows, number, Specifies the visible number of lines...
Read more >
Forms in HTML documents - W3C
Authors may create two types of controls that allow users to input text. The INPUT element creates a single-line input control and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found