Announcement

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

    hint style still showing after input

    We have a text item that has a style and setShowHintInField(true). After typing an input, the text item still shows the hint style.

    Code:
    TextItem item = new TextItem("name");
    item.setTextBoxStyle("style");
    item.setHint("Type here");
    item.setShowHintInField(true);
    We just upgraded to 4.1p 20140407. It was working before with 4.0p 20140115.

    FF26. GWT 2.5.1

    #2
    We're not reproducing this issue.

    We used the textBoxStyle "button" (as we know this is an existent style for buttons and includes the "Focused" variant shown when the item has focus by default), and it worked for us.

    Is it possible you're missing the required CSS style definitions to match this custom style ("style" in this case)?

    Thanks
    Isomorphic Software

    Comment


      #3
      I did some further tests and found out that it happens after changing the icon for the text item while out of focus. For the below test case,

      1. click on a button
      2. type something in the text item
      - notice the hint is gone and the typed text's font is black
      3. click outside the text item before 3 seconds
      - notice the text is still black
      4. when the 3 seconds is up, the font changes to gray again

      I also added a second button because I thought it was the way I was changing the icon (calling FormItemIcon.setSrc vs. FormItem.setIcons) but both ways yield the same result: the style changes to the hint style (I've confirmed that with Firebug).

      I've also noticed that if I leave the focus in the text item, the font will stay black if I click outside after the 3 seconds is up.
      Code:
      TextItem t = new TextItem("name");
      t.setTextBoxStyle("style");
      t.setHint("Type here");
      t.setShowHintInField(true);
      
      final FormItemIcon i1 = new FormItemIcon();
      i1.setSrc("[SKIN]/loadingSmall.gif");
      
      final FormItemIcon i2 = new FormItemIcon();
      i2.setSrc("[SKIN]/actions/approve.png");
      
      final Timer timer = new Timer() {
        public void run() {
          i1.setSrc("[SKIN]/actions/approve.png");
          t.redraw();
        }
      };
      
      final Timer timer2 = new Timer() {
        public void run() {
          t.setIcons(i2);
        }
      };
      
      DynamicForm f = new DynamicForm();
      f.setItems(t);
      f.draw();
      
      IButton b = new IButton("reset");
      b.addClickHandler() {
        public void onClick(ClickEvent e) {
          timer.cancel();
          timer.schedule(3000);
      
          i1.setSrc("[SKIN]/loadingSmall.gif");
          t.setIcons(i1);
          t.redraw();
        }
      });
      b.draw();
      b.setPageTop(50);
      
      IButton b2 = new IButton("reset");
      b2.addClickHandler() {
        public void onClick(ClickEvent e) {
          timer2.cancel();
          timer2.schedule(3000);
      
          i1.setSrc("[SKIN]/loadingSmall.gif");
          t.setIcons(i1);
          t.redraw();
        }
      });
      
      b2.draw();
      b2.setPageTop(70);
      CSS
      Code:
      style,
      styleFocused,
      styleHint {
        font-weight: bold;
      }
      styleHint {
        color: gray;
      }

      Comment


        #4
        Thanks for the follow up. This gave us enough to figure out what was going on.
        We've made a change to address this. Please see the next 4.1p / 5.0d nightly build.

        Regards
        Isomorphic Software

        Comment

        Working...
        X