Results 1 to 2 of 2

Thread: Key Event gets passed down and written as textfield's value

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Sep 2015
    Location
    Europe
    Posts
    9

    Exclamation Key Event gets passed down and written as textfield's value

    Hello dear Sencha Team !

    We encountered a strange behaviour/bug using Ext.util.KeyMap which passes its event key ('m' for example) to a textfield of a popup that gets focused upon creation. It seems that it works fine on Linux, but strangely not on Windows.

    Ext version used:

    • Ext 5.1.2
    Browser versions tested against:
    • FF 47.0 & 48.0
    • Chrome 52.0.2743.116 (64-bit)
    DOCTYPE tested against:
    • HTML
    Description:

    The key binding calls a controller's function that creates a usual popup (xtype 'window') with textfields that can be filled to create a record which gets added to the grid's store upon clicking 'save'.

    That window/popup has the properties 'autoShow' set to true and has a listener for the 'show' event where it gets the first of its 'textfield' objects and uses the 'focus()' function on it, so that the user can immediately type something without having to select it manually using the mouse.

    Now, the key of the event ('m' was used, but doesn't matter) gets passed down to the textfield and writes the 'm' into the textfield upon creation.

    Using 'preventDefault' or 'stopEvent' as the setting for the 'defaultEventAction' seems to work on a Linux machine (14.04) with both FF (47.0) and Chrome (52.0), but still passes the 'm' character to the textfield on a Windows (7) machine.

    When trying to debug and step through until after the 'focus()' function, the problem could not be reproduced as it somehow doesn't get passed to the text field.

    We tried to get the value of the text field at the end of the function that is bound to the key and also to stop the event and/or its propagation manually, but it didn't have any impact.

    Is this a problem of ExtJS-internal events (not correctly) interacting with browser's events?

    Is this definitely a bug that needs to be fixed or is there some sort of workaround or some special event handling which needs to be done?

    Steps to reproduce the problem:
    • Try this fiddle: https://fiddle.sencha.com/#fiddle/1faa
    • Use the specified shortcut key (here: 'm') to create the popup with the 'defaultEventAction' property of the key binding both being used and not used.
    The result that was expected:
    • The textfield of the created popup gets focused and is empty
    • The key event doesn't get passed down to the popup's textfield
    The result that occurs instead:
    • The key ('m' in the fiddle, but doesn't matter) of the event gets passed down to the focused textfield although 'preventDefault' is used as defaultEventAction

    We hope to hear soon from you and thanks in advance !

  2. #2
    Sencha Premium User
    Join Date
    Sep 2015
    Location
    Europe
    Posts
    9

    Default

    it looks like we managed to fix it ...
    it seems the solution was to use the 'focus()' function with the parameters "focus(false, 1)" to delay the focus for 1ms.

    would have been nice if we got at least an answer, given it's quite a trivial fix/no actual bug, but well ... thanks anyways.

Similar Threads

  1. [FIXED] Node not passed to load event
    By westy in forum Ext 5: Bugs
    Replies: 1
    Last Post: 13 Jun 2014, 11:46 AM
  2. [FIXED] [2.1] Tap event is passed to the textfield in new view
    By Steffen Hiller in forum Sencha Touch 2.x: Bugs
    Replies: 20
    Last Post: 26 Mar 2014, 10:43 PM
  3. Replies: 0
    Last Post: 15 Apr 2011, 10:39 AM
  4. textfield not being passed to script
    By PCSpectra in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 17 Feb 2010, 2:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •