Skip to content

Commit

Permalink
trigger changeValue on blur in ios
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Oct 18, 2023
1 parent 4ea0067 commit d14288c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 19 deletions.
10 changes: 9 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
0.47.4 2023-10-18 22:53:53 +0200 Tobias Oetiker <tobi@oetiker.ch>

- it seems on ios there is no changeValue after blur, fix that by
resettting and setting the value explicitly after blur ... aargh

- explicitly check for empty string in required field even when there
is no validator defined

0.47.3 2023-08-29 16:20:30 +0200 Tobias Oetiker <tobi@oetiker.ch>

- make table columns with flex with work on mobile devices
- make table columns with "flex" work on mobile devices

0.47.2 2023-08-29 14:14:54 +0200 Tobias Oetiker <tobi@oetiker.ch>

Expand Down
12 changes: 6 additions & 6 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ WriteMakefile(
AUTHOR => 'Tobias Oetiker <tobi@oetiker.ch>',
LICENSE => 'gpl_3',
PREREQ_PM => {
'Mojolicious' => '9.12',
'Mojolicious' => '9.33',
'Mojolicious::Plugin::Qooxdoo' => '1.0.14',
'Config::Grammar' => '1.13',
'XS::Parse::Keyword' => '0.21',
'Future::AsyncAwait' => '0.54',
'Syntax::Keyword::Try' => '0.25',
'XS::Parse::Keyword' => '0.38',
'Future::AsyncAwait' => '0.65',
'Syntax::Keyword::Try' => '0.29',
'Locale::PO' => '0.27',
'JSON::Validator' => 5.03,
'YAML::XS' => 0.83,
'JSON::Validator' => '5.14',
'YAML::XS' => '0.88',
'Text::CSV' => 0,
'Excel::Writer::XLSX' => 0,
'Test::Fatal' => 0,
Expand Down
2 changes: 1 addition & 1 deletion lib/CallBackery.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use CallBackery::Plugin::Doc;
use CallBackery::Database;
use CallBackery::User;

our $VERSION = '0.47.3';
our $VERSION = '0.47.4';


=head2 config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ qx.Class.define("callbackery.ui.form.Auto", {
this);

var formWgt = new (formRenderer)(form);
var fl = formWgt.getLayout();

this._add(formWgt);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ qx.Class.define("callbackery.ui.plugin.Action", {
+ 'mmButton';
this.addOwnedQxObject(mmButton, mmBtnId);
}
var action = function () {
let action_code = function () {
var that = this;
if (!button.isEnabled()) {
return;
Expand Down Expand Up @@ -460,7 +460,9 @@ qx.Class.define("callbackery.ui.plugin.Action", {
default:
this.debug('Invalid execute action:' + btCfg.action);
}
}; // var action = function() { ... };
}; // action_code
// wrap action such that it executes only after the event loop is free again
var action = () => setTimeout(action_code.bind(this),0);

if (btCfg.defaultAction) {
this._defaultAction = action;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,20 @@ qx.Class.define("callbackery.ui.plugin.Form", {
var control = form.getControl(s.key);
var callback = function(e){
if (this._reconfSelectBoxRunning > 0) return;
var data = e.getData();
let data = null;
if (control.getValue) {
data = control.getValue();
// try to make qx see that the value changed
// after loosing focus
// when running in safari on ios
control.resetValue();
control.setValue(data);
}
// handle events from selectboxes
if (control.getSelection && qx.lang.Type.isArray(data)){
else if (control.getSelection && qx.lang.Type.isArray(data)){
if (data.length > 0 && data[0]['getModel']){
data = data[0].getModel();
}
else {
data = null;
}
}
var required = control.getRequired();
if (required){
Expand Down Expand Up @@ -196,9 +201,11 @@ qx.Class.define("callbackery.ui.plugin.Form", {
}
};
if (control.getSelection){
control.getSelection().addListener("change", callback, this); }
control.getSelection().addListener("change", callback, this);
}
else {
control.addListener('changeValue',callback,this);
// did we leave the field ?
control.addListener('blur',callback,this);
}
},this);
},
Expand Down

0 comments on commit d14288c

Please sign in to comment.