-
11 Jan 2013 11:51 PM #1
TextButton inside a ContentPanel has unwanted top margin in IE
TextButton inside a ContentPanel has unwanted top margin in IE
I noticed that in IE 8, when I place a TextButton inside a Content Panel, it has unwanted top margin. It works fine in Chrome and FF though. I'm posted a standalone test case and screenshot below. I'm using GXT v3.0.1.
Sencha_GXT_TextButton_ContentPanel.jpgCode:package com.hello.gxt.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.sencha.gxt.widget.core.client.ContentPanel; import com.sencha.gxt.widget.core.client.button.TextButton; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; public class HelloGXT implements IsWidget, EntryPoint { private ContentPanel root; @Override public Widget asWidget() { if (root == null) { root = new ContentPanel(); root.setHeaderVisible(false); root.setPixelSize(200, 100); TextButton btn = new TextButton("Test Button"); VerticalLayoutContainer con = new VerticalLayoutContainer(); con.add(btn, new VerticalLayoutData(-1, -1)); root.setWidget(con); } return root; } @Override public void onModuleLoad() { RootPanel.get().add(asWidget()); } }
-
31 Jan 2013 4:06 AM #2
Top margin in IE
Top margin in IE
We have the same problem in IE 8. IE 9 works.
Used versions 3.0.3 and 3.0.4-Nightly-Build
-
31 Jan 2013 10:54 AM #3
Thanks for the report - I can reproduce this in IE8, and have filed it internally.
deepfriedbrain, from the extra padding around the ContentPanel, it appears you have either not added the reset.css to your html page (as described in setup.txt), or you have the GWT Clean theme added in your module file. The Clean theme adds padding in several areas where GXT expects there to be none, and can prevent certain things like the Viewport from behaving correctly. This does not effect the bug - it happens with or without it. That said, it makes this simplified bug harder to notice correctly.
Here's a simplified test that clearly shows that the TextButton is at fault, and that the ContentPanel (and VLC) is just a red herring:
screenshot18.pngCode:public class Test implements EntryPoint { @Override public void onModuleLoad() { RootPanel.get().add(new TextButton("test")); } }
-
1 Feb 2013 12:38 AM #4
I use ToggleButton. Don“t know if it is important for your fix.
-
1 Feb 2013 8:12 AM #5
It probably won't make any difference - ToggleButton appears to only add different behavior to TextButton, not new rendering - but any additional context/details are always nice to have.
-
18 Feb 2013 6:46 AM #6
Hello,
maybe it helps:
btn.getElement().getStyle().setDisplay(Display.BLOCK); is my workaround...
A button receives the display:inline-block css-property but i could not find this property in ButtonCell.css to overwrite it.
You found a bug! We've classified it as
EXTGWT-2800
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote