Skip to content

Commit

Permalink
Fixes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
cboulanger committed Jun 18, 2018
1 parent 17a606b commit 5092ca4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
8 changes: 5 additions & 3 deletions source/class/dialog/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,12 @@ qx.Class.define("dialog.Form", {
hbox.add(this._message, {
flex: 1
});
// wrap fields in form tag to avoid Chrome warnings, see https://github.com/cboulanger/qx-contrib-Dialog/issues/19
var formTag = new dialog.FormTag();
this._formContainer = new qx.ui.container.Composite();
this._formContainer.setLayout(new qx.ui.layout.Grow());
container.add(this._formContainer, {
flex: 1
});
formTag.add( this._formContainer, {flex: 1} );
container.add(formTag, { flex: 1 });
var buttonPane = new qx.ui.container.Composite();
var bpLayout = new qx.ui.layout.HBox(5);
bpLayout.setAlignX("center");
Expand Down Expand Up @@ -209,6 +210,7 @@ qx.Class.define("dialog.Form", {
case "passwordfield":
case "password":
formElement = new qx.ui.form.PasswordField();
formElement.getContentElement().setAttribute("autocomplete", "password");
break;
case "combobox":
formElement = new qx.ui.form.ComboBox();
Expand Down
36 changes: 36 additions & 0 deletions source/class/dialog/FormTag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* ************************************************************************
qooxdoo dialog library
http://qooxdoo.org/contrib/catalog/#Dialog
Copyright:
2018 Derrell Lipman
License:
MIT: https://opensource.org/licenses/MIT
Authors:
* Derrell Lipman
************************************************************************ */

qx.Class.define("dialog.FormTag",
{
extend : qx.ui.container.Composite,

construct : function(layout)
{
this.base(arguments, layout || new qx.ui.layout.VBox() );
},

members :
{
// overridden
// Instead of creating a <div> for the content element, use <form>
_createContentElement : function()
{
return new qx.html.Element("form");
}
}
});
6 changes: 5 additions & 1 deletion source/class/dialog/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,14 @@ qx.Class.define("dialog.Login", {
* Create the main content of the widget
*/
_createWidgetContent: function() {
// wrap fields in form tag to avoid Chrome warnings, see https://github.com/cboulanger/qx-contrib-Dialog/issues/19
var formTag = new dialog.FormTag();
var container = new qx.ui.container.Composite();
formTag.add(container, {flex:1});
var layout = new qx.ui.layout.VBox(10);
layout.setAlignX("center");
container.setLayout(layout);
this.add(container);
this.add(formTag);
this._image = new qx.ui.basic.Image();
this._image.setVisibility("excluded");
container.add(this._image);
Expand Down Expand Up @@ -162,6 +165,7 @@ qx.Class.define("dialog.Login", {
}
this._username = new qx.ui.form.TextField();
this._password = new qx.ui.form.PasswordField();
this._password .getContentElement().setAttribute("autocomplete", "password");
this._password.addListener(
"keypress",
function(e) {
Expand Down

0 comments on commit 5092ca4

Please sign in to comment.