Announcement

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

    IE button highlight does not account for padding

    Hi all,
    I have found this issue in Internet Explorer when highlighting plain looking buttons. It looks like the highlight around the button does not get any wider when you add horizontal padding.
    The issue only occurs when the button's width is less than the width of the text + padding or if "autoFit" is true.
    I've included sample html that demonstrates the issue and some screenshots. If there is a fix in place or something that can be done to prevent this it would be greatly appreciated.

    [HTML]<!DOCTYPE html>
    <html>
    <head>
    <style type="text/css">
    .button,
    .buttonOver,
    .buttonFocused,
    .buttonFocusedOver,
    .buttonDown,
    .buttonFocusedDown,
    .buttonSelected,
    .buttonSelectedFocused,
    .buttonSelectedDown,
    .buttonSelectedFocusedDown,
    .buttonSelectedOver,
    .buttonSelectedFocusedOver,
    .buttonDisabled,
    .buttonSelectedDisabled {
    padding:10px;
    }
    </style>
    <script src="%ISC_DIR%/ISC_Core.js"></script><!-- replace %ISC_DIR% with the location of files -->
    <script src="%ISC_DIR%/ISC_Foundation.js"></script>
    </head>
    <body>
    <script type="text/javascript">
    isc.Button.create({
    title: "title",
    viewName: "name",
    height: 19,
    autoFit: true,
    overflow: 'visible'
    });
    </script>
    </body>
    </html>[/HTML]

    Button without padding in IE:
    Click image for larger version

Name:	withoutPadding.PNG
Views:	38
Size:	1.2 KB
ID:	238716

    Button with padding in IE:
    Click image for larger version

Name:	withPadding.PNG
Views:	48
Size:	3.0 KB
ID:	238717
    ^ This is the problem

    Button without padding in chrome:
    Click image for larger version

Name:	withoutPaddingChrome.PNG
Views:	57
Size:	1.9 KB
ID:	238718

    Button with padding in chrome:
    Click image for larger version

Name:	withPaddingChrome.PNG
Views:	47
Size:	2.8 KB
ID:	238719
    ^ This is the expected behaviour

    Browser:
    IE only

    SC Version:
    v9.1p_2016-04-15/Pro Development Only

    Thanks,
    Connor

    #2
    We don't actually draw the focus indicator - IE does it - so if some version of IE misplacing it (you forgot to mention your version of IE and Windows), our only option is to suppress the native indicator and add one via CSS.

    We already do this in 11.0, so if you need a workaround for this native issue, we'd suggest either upgrading or taking the same approach you see used in 6.0.

    Comment


      #3
      I'm on a windows 7 computer. I'm using IE11 but I see the issue when I set the developer console to edge, 10, or 9. IE 8, 7, and 5 look okay.

      Are 11.0 and 6.0 versions of SmartClient? What is the approach used in 6.0?

      Comment


        #4
        Looking at the html for this button, I'm not sure if this is just a problem with IE. The html being generated is different in IE compared to google chrome. The widths in chrome are the text width plus padding but the widths in IE are only the text width.

        Google Chrome DOM:Click image for larger version

Name:	buttonDOMChrome.PNG
Views:	47
Size:	95.6 KB
ID:	238739

        IE DOM: problem elementClick image for larger version

Name:	buttonDOM.PNG
Views:	43
Size:	66.9 KB
ID:	238737

        This element seems to be the correct size in IE even though it has a "width" of 25 setClick image for larger version

Name:	buttonDOM1.PNG
Views:	53
Size:	66.1 KB
ID:	238738

        Comment


          #5
          11.0 is a SmartClient version and 6.0 is the equivalent SmartGWT version.

          Yes, the HTML frequently has to be different for IE, and sometimes you will see counter-intuitive settings inside the HTML for IE because it's the only approach that works given several interlocking bugs in IE.

          Regardless, IE is obviously drawing the wrong thing, and the only approach to fix the problem is the one we've already explained (and applied).

          Comment


            #6
            Alright, I'll wait until our next SmartClient upgrade and revisit this. Thanks.

            Out of curiosity though, how are we sure that this is an IE problem when it's doing what the html is telling it to do? If i set the "width" of the div in IE to 45 instead of 25 the button is the correct size (until I hover over it and it reverts). Similarly, when I set the "width" of the div in chrome to 25 instead of 45 I get the same malformed indicator I see in IE. Both browsers seem to interpret the html the same way, but the html being passed to IE is telling it to do the wrong thing. Why isn't the width set to the correct value like it is in chrome, since it does work in IE?

            Comment


              #7
              As we've covered, IE has dozens of interlocking bugs that force us to use HTML that may appear broken.

              In this one Button, used in this one way, your HTML change didn't have obvious bad effects. There are other modes, contexts or APIs you could call where it would.

              Comment

              Working...
              X