Reputation: 1771
How can i disable horizontal scroll bar in gwt-richtextarea
I applied overflow-x:hidden and is working fine on firefox but not working on IE
Upvotes: 1
Views: 641
Reputation: 9741
RichTextArea
uses an iframe
to embed the editable html document.
When you set styles to the rich area, you are setting them to the iframe
element, but in your case you have to set styles to the body
element of the iframe #document
.
The problem here is how to get the content document of the iframe, you have to use jsni, or use a 3party library like gwt-query.
This works with qQuery:
import static com.google.gwt.query.client.GQuery.*;
RichTextArea area = new RichTextArea();
RootPanel.get().add(area);
$(area).contents().find("body").css($$("overflow-x: hidden"));
Another issue is that the creation of the editable document in the iframe is delayed in gwt. So it is safer if you delay the setting of styles, using a Timer
.
With gquery you can use the delay()
method
$(area).delay(100,
lazy().contents().find("body").css($$("overflow-x: hidden")).done()
);
Upvotes: 1