Announcement

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

    TextItem caret issue (IE9)

    Hi!

    We're facing the following issue:
    When positioning the cursor on the last position, the cursor jumps to the first position. We're seeing this on IE9 using the latest 3.1 nightly build.

    Repro case:
    1. Run the EntryPoint below
    2. Type in some text in TextItem no1.
    3. Type in some text in TextItem no2.
    4. Click with the mouse on TextItem no1.
    -> Cursor jumps from last position to the first position
    Code:
    public class StandaloneTestcase implements EntryPoint {
    
    	public void onModuleLoad() {
    		DynamicForm form = new DynamicForm();
    		form.setWidth(400);
    		form.setSelectOnFocus(true);
    
    		TextItem textItem1 = new TextItem();
    		textItem1.setName("textItem1");
    		textItem1.setTitle("TextItem no 1");
    		textItem1.setFormatOnFocusChange(true); //setFormatOnFocusChange !
    		textItem1.setEditorValueFormatter(formItemValueFormatter);
    
    		TextItem textItem2 = new TextItem();
    		textItem2.setName("textItem2");
    		textItem2.setTitle("TextItem no 2");
    		
    		form.setFields(textItem1, textItem2);
    		form.draw();
    	}
    
    	private FormItemValueFormatter formItemValueFormatter = new FormItemValueFormatter() {
    
    		public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
    			if (value == null)
    				return "";
    			// form.getFocusItem(); not reliable, as documentation states
    			if (hasFocus(item)) {
    				return value.toString();
    			} else {
    				return "(no focus) " + value.toString();
    			}
    		}
    
    	};
    	
    	public static native boolean hasFocus(FormItem item) /*-{
    		var self = item.@com.smartgwt.client.core.DataClass::getJsObj()();
    		if (self && self.hasFocus != null) {
    			return self.hasFocus;
    		}
    		return false;
    	}-*/;
    
    }

    Thx!

    #2
    Hi,

    It's been a while and we're still able to reproduce this issue on the latest nightly of 3.1d.
    Are you able the reproduce this issue?

    Thx!

    Comment


      #3
      Hi. Sorry for the delay getting back to you on this one - it appears it may have been missed.
      We'll assign an engineer to take a look and let you know what we find

      Regards
      Isomorphic Software

      Comment


        #4
        A quick follow up to let you know this isn't forgotten. We are reproducing the problem but it's proving somewhat tricky to fully isolate the cause and fix. We'll keep you posted.

        Comment


          #5
          It turned out to be an entirely native behavior when you change the value of a text-item in response to a focus event.

          You can reproduce this in a simple standalone test case with no SmartClient loaded - for example:
          Code:
          <html>
          <head>
          </head>
          <body>
          <input onfocus="document.getElementById('testInput').value = 'X X X X X!';" ID="testInput">
          <br>
          <input>
          </body>
          </html>
          Regardless - we've added some logic to explicitly work around this by forcing focus back to the *end* of the text box when this occurs. This will be present in the next 3.1 nightly build.

          Comment


            #6
            Hi!
            Unfortunately, we're still able to reproduce this issue.
            We're seeing different behavior in FF, IE and Chrome.
            Is it possible to have another look into it?

            FF: Select on click works (only if 'focused' display value is the same as non focused display value)
            IE: Non consistent behavior
            Chrome: Select ok on mouse dropdown, but as soon as mouse up event occurs value is deselected again

            Comment


              #7
              Just a quick update to note that this is queued up for investigation. We'll let you know when we have more information

              Thanks
              Isomorphic Software

              Comment


                #8
                We're no longer able to reproduce problems in this area. Can you please clarify the following information:

                1) Which exact build are you using (full version string)
                2) Are you still using the text case at the top of this thread, or something else? If something else can you show us sample code.
                3) Can you break down the exact steps to reproduce (including details of expected vs actual behavior).

                Also - any other details that might be relevant (What doctype is specified on your bootstrap HTML page? What OS are you observing this behavior on? Are you looking at the most recent versions of each browser?)

                Thanks
                Isomorphic Software

                Comment


                  #9
                  Hi!

                  We're in the process of moving to SmartGWT 4 and this issue isn't reproducible anymore on the latest build.

                  Thank you for your efforts in this!

                  Comment

                  Working...
                  X