Default command is triggered inside text areas
See original GitHub issueSummary
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:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mertsincan as it was your change, would you like to check it?
@mertsincan Debugging this it appears in this line…
$(e.target) is the FORM and not the TEXTAREA.