Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[form] not working click input after initialise form #746

Closed
apple-idn opened this issue May 16, 2019 · 7 comments
Closed

[form] not working click input after initialise form #746

apple-idn opened this issue May 16, 2019 · 7 comments
Assignees
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Milestone

Comments

@apple-idn
Copy link

apple-idn commented May 16, 2019

Bug Report

[Form] Inside on click form not working

Steps to reproduce

  1. create input file in field
  2. initialize ui.form(if not initialise form working fine)
  3. click file not running script
  4. before FUI 2.7.5 its working fine

Expected result

open file it open

Actual result

not working input click

Testcase

https://jsfiddle.net/allwe/1bpuv5r8/2/

Screenshot (when possible)

Version

2.7.5

@lubber-de lubber-de added the type/bug Any issue which is a bug or PR which fixes a bug label May 16, 2019
@lubber-de
Copy link
Member

lubber-de commented May 16, 2019

Regression since adf5937 through #661 which implemented the clean/dirty states to a form stopped the event propagation in the isDirty method:

if (e) {
e.stopImmediatePropagation();
}

If e.stopImmediatePropagation(); is removed, the issue is fixed.

@prudho Do you know why this line was necessary (or how we can fix it otherwise) ?

@lubber-de lubber-de added the lang/javascript Anything involving JavaScript label May 16, 2019
@lubber-de lubber-de added this to the 2.7.6 milestone May 16, 2019
@apple-idn
Copy link
Author

apple-idn commented May 18, 2019

err

not fixed type file(empty file)
** type file on change** not work @lubber-de

@lubber-de
Copy link
Member

@apple-idn As said, if the above mentioned line is removed, then your issue is fixed.
See your adjusted fiddle https://jsfiddle.net/ea1urjgs/

@prudho Do you remember why the above mentioned stopPropagation was needed in the isDirty method?

@prudho
Copy link
Contributor

prudho commented May 20, 2019

MMmmmh... I'm not sure, maybe it's to avoid triggering multiple events when more than one item is selected. We should do some tests to be sure enough to remove it.

@lubber-de lubber-de self-assigned this May 20, 2019
@apple-idn
Copy link
Author

apple-idn commented May 20, 2019

thanks @lubber-de BUT answer not complete where input type files empty(not execution), where $('body').on('change', 'input[type="file"]', function(e) {..... not running after, same case if only input type file on form i's EMPTY how do that fix input type file "empty"
see my fiddle
https://jsfiddle.net/allwe/dftr12Le/4/

billa

@lubber-de
Copy link
Member

It's fixed now by #767
@apple-idn
I adjusted your latest fiddle. The reason, why the file input was not updating the filename was unfortunately because of many bugs in your code

 <input class="dede" type="text" placeholder="Pilih File (*.xlsx)..." readonly="" nama="dum_file">
<!-- name instead of nama -->
//$($this) has to be $(this)
  var ini = $($this);
  console.log(e);
  var himp = $(this).closest('.action');
  var filename = e.target.files[0].name;
// selector has to be 'input[name="dum_file"]
// filename instead of fileName (typo)
  himp.find('input[type="dum_file"]').val(fileName);

I corrected everything here😉
See https://jsfiddle.net/y0dsjotp/2/

@apple-idn
Copy link
Author

wow it's very clear and fixed thanks very much @lubber-de

@lubber-de lubber-de added the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Jun 10, 2019
@y0hami y0hami closed this as completed in 2b33903 Jun 16, 2019
@lubber-de lubber-de removed the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants