Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Cursor jumping behaviour in TextAreaItem when setHint called in IE

    SmartClient Version: v9.1p_2016-04-09/Pro Deployment (built 2016-04-09)
    This behaviour only seems to occur in IE11 (tried in 11.0.9600.18231), it does not appear to happen in Chrome or Firefox that I have seen - sadly IE is the standard browser at my company, so I need a solution that works for that browser.

    I am using a TextAreaItem hint to display the number of lines entered into the text box. I have a ChangedHandler firing after each update to re-calculate the number after each user edit, however what I've noticed is that when the setHint() method is called, in IE, the cursor jumps around the value list. If the user deletes a character in the middle of the list, the cursor jumps to the next character, rather than staying in the logical place. I do not see this behaviour in Chrome or Firefox so I presume it's IE-specific, but I need a solution that works for all browser as my users cannot control what browser they use.

    Here is a sample app that displays the behaviour if run in IE11. (Note: I've tried running in compatibility mode too).

    Add a few lines of text, then delete some characters from the middle of the text - observe strange jumping behaviour.
    Then try the same thing in Chrome or Firefox - editing behaviour appears normal.

    Code:
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.TextAreaItem;
    import com.smartgwt.client.widgets.form.fields.TextItem;
    import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
    import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
    
    /**
     * Title:        Test<br>
     * Description:  Sandbox for testing stuff<br>
     */
    public class Test implements EntryPoint {
        
        /**
         * {@inheritDoc}
         */
        @Override
        public void onModuleLoad() {
            SC.showConsole();        
            
            // Cursor jumps around field when the values in this text area are edited in IE11
            final TextAreaItem jumping = new TextAreaItem("jumping", "Jumping");
            jumping.setHeight( 50 );
            jumping.setHint( "Initial hint" );
            jumping.addChangedHandler( new ChangedHandler() {
    
                @Override
                public void onChanged( ChangedEvent event ) {
                    
                    jumping.setHint( event.toDebugString() + ": Calculated value" );
                }
            });
            
            DynamicForm form = new DynamicForm();
            form.setWidth100();
            form.setFields( jumping );
            
            Canvas layout = new Canvas();
            layout.setWidth100();
            layout.setHeight100();
            layout.addChild( form );
            layout.show();
        }
    }

    #2
    Hi firebet,

    please see this thread on IE11 + SmartGWT 4.1p.

    Best regards
    Blama

    Comment


      #3
      Ah. That might explain it! Thanks for the pointer.

      Comment

      Working...
      X