<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 09:00:10 CET 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[MGNLUI-2788] Support of RETURN/ENTER key to confirm forms &amp; dialogs</title>
                <link>https://jira.magnolia-cms.com/browse/MGNLUI-2788</link>
                <project id="10625" key="MGNLUI">Magnolia UI</project>
                    <description>&lt;p&gt;Pressing Enter key should submit a form, the same as pushing the Save or Confirm button. But this shortcut key should not trigger the action if the focus is currently in a textarea or richtextfield, because a user may simply want to add an enter.&lt;br/&gt;
It is straightforward to add the ENTER key handling (see BaseDialogPresenter), its hard to prevent it from firing when textarea has focus. Vaadin does not provide a mechanism to know which field has focus.&lt;/p&gt;

&lt;p&gt;Failed attempts:&lt;br/&gt;
I tried handling the enter key with BaseDialogPresenter#addShortcut method and alternatively with a shortcut on the Confirm button via &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Button commitButton = (Button)(editorActionAreaView.getViewForAction(BaseDialog.COMMIT_ACTION_NAME).asVaadinComponent());
        commitButton.setClickShortcut(KeyCode.ENTER);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;With both those methods - the following failed:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Wrapping the textarea in a Panel. (In a last ditch effort to create a different shortcut scope that did not include the textarea.&lt;/li&gt;
	&lt;li&gt;Creating a Vaadin gtw extension that captured all keyboard events and stopped their propogation.&lt;br/&gt;
(&lt;a href=&quot;https://vaadin.com/book/vaadin7/-/page/gwt.extension.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://vaadin.com/book/vaadin7/-/page/gwt.extension.html&lt;/a&gt;)
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
pw.addDomHandler(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; KeyPressHandler() {
            @Override
            &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void onKeyPress(KeyPressEvent event) {
                event.stopPropagation();
                event.getNativeEvent().stopPropagation();
                event.preventDefault();
                event.getNativeEvent().preventDefault();
            }
        }, KeyPressEvent.getType());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The textarea was extended with this.&lt;br/&gt;
That this did not work makes me think that the vaadin keyboard handling works with the Javascript event CAPTURE phase rather then the BUBBLE phase, so that the button cannot stop the propogation of the event to the dialog, because the dialog got the event before the textarea did.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Possible Approaches:&lt;br/&gt;
Overall the Vaadin keyboard shortcut handling is limited and hard to scope - I could see dropping it in favor of a custom approach.&lt;br/&gt;
1.&lt;br/&gt;
Specific to this case, I could see creating another vaadin extension to apply to the dialog, and handle the keyboard events in there instead of in the BaseDialogPresenter. Handle them on the client side. For one, you could make sure to catch only the BUBBLING events so that the field could cancel them. Or you could do an explicit check if the focused element is a textarea.&lt;br/&gt;
2.&lt;br/&gt;
The RichTextArea is actually not a problem, if you are in it the ENTER key does not confirm the dialog - I guess thats because it is in an iframe. I dont think its pretty - but the TextArea could also put itself in an iframe.&lt;/p&gt;


</description>
                <environment></environment>
        <key id="37675">MGNLUI-2788</key>
            <summary>Support of RETURN/ENTER key to confirm forms &amp; dialogs</summary>
                <type id="5" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10896&amp;avatarType=issuetype">Sub-task</type>
                            <parent id="32807">MGNLUI-1978</parent>
                                    <priority id="3" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="czimmermann">Christopher Zimmermann</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Apr 2014 13:28:28 +0200</created>
                <updated>Thu, 10 Apr 2014 18:46:55 +0200</updated>
                            <resolved>Thu, 10 Apr 2014 18:44:42 +0200</resolved>
                                    <version>5.2.3</version>
                                                    <component>user interaction</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="82587" author="jchocholacek" created="Fri, 4 Apr 2014 08:32:32 +0200"  >&lt;p&gt;What about adding a &lt;tt&gt;FieldEvents.FocusListener&lt;/tt&gt; and &lt;tt&gt;FieldEvents.BlurListener&lt;/tt&gt; (from the &lt;tt&gt;com.vaadin.event&lt;/tt&gt; package) to the &lt;tt&gt;Field&lt;/tt&gt; constructed by the &lt;tt&gt;TextFieldFactory&lt;/tt&gt;, that will turn off/on the ENTER key handling in case that the TextField has more than one row, i.e. it is represented by a TextArea?&lt;/p&gt;</comment>
                            <comment id="83129" author="czimmermann" created="Thu, 10 Apr 2014 18:44:42 +0200"  >&lt;p&gt;Its easy to implement as part of &lt;a href=&quot;https://jira.magnolia-cms.com/browse/MGNLUI-3673&quot; title=&quot;Field Validator Error Messages for type Double &quot; class=&quot;issue-link&quot; data-issue-key=&quot;MGNLUI-3673&quot;&gt;&lt;del&gt;MGNLUI-3673&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10021">
                    <name>duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="36490">MGNLUI-2673</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>magnolia-cms.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 4 Apr 2014 08:32:32 +0200</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ajones</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 45 weeks, 3 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>czimmermann</customfieldvalue>
            <customfieldvalue>jchocholacek</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i038yf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>19047</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>