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

Use onchange as well as onfocus for radio buttons #4252

Merged

Conversation

ZitaNemeckova
Copy link
Contributor

Firefox on MacOS doesn't fire onfocus when radio button is clicked. And it's by design as seen here here here so adding onchange to do the same as onfocus.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1594714

How to reproduce:

  1. Using Firefox, create a new custom button of type "Ansible Playbook". Select "Target Machine" as the inventory type. Complete the remaining button details and save.
  2. Observe that the Target has been set to "localhost"
  3. Try to edit the button. Observe that changing the "Inventory" radio button value does not enable the 'Save' button.
  4. Change the button name (which does re-enable the 'Save' button), and change the "Inventory" radio button value to "Target Machine". Save the change

Before:
Save/Reset buttons disabled.
Change to Inventory not saved.
After:
Save/Reset buttons enabled
Change to Inventory saved.

@miq-bot add_label bug, blocker, gaprindashvili/yes

@ZitaNemeckova
Copy link
Contributor Author

@AparnaKarve please have a look. It's MacOS specific issue. Thanks :)

@miq-bot
Copy link
Member

miq-bot commented Jul 4, 2018

Checked commit ZitaNemeckova@04c8cb9 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@martinpovolny
Copy link
Member

ping @lpichler : can you, please, test this? (in case @AparnaKarve is too busy)

Thx!

@AparnaKarve
Copy link
Contributor

AparnaKarve commented Jul 5, 2018

@ZitaNemeckova I could reproduce the error and can confirm that Save is enabled in Firefox after changing the Inventory type from Target Machine (original value) to Localhost.

Although, changing it from Localhost back to the original value Target Machine did not gray out the Save/Reset buttons, which would have been the expected behavior.

... given that it is an old non-angular form, I think the current behavior with the fix is quite OK
So OK by me, even though the graying out does not work (buttons not graying out is not a blocker, IMO)

@JPrause
Copy link
Member

JPrause commented Jul 6, 2018

@ZitaNemeckova is this ready to be merged,..if yes, who can do that.

@h-kataria h-kataria added this to the Sprint 90 Ending Jul 16, 2018 milestone Jul 6, 2018
@h-kataria h-kataria merged commit eff0299 into ManageIQ:master Jul 6, 2018
simaishi pushed a commit that referenced this pull request Jul 11, 2018
Use onchange as well as onfocus for radio buttons
(cherry picked from commit eff0299)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1598873
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 018c162bbce975e33c9ab6abee453323464d2578
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Fri Jul 6 05:15:40 2018 -1000

    Merge pull request #4252 from ZitaNemeckova/fix_onfocus_radion_buttons
    
    Use onchange as well as onfocus for radio buttons
    (cherry picked from commit eff02998bfdeaf4bcfed18e1a585da8abb25e776)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1598873

@himdel
Copy link
Contributor

himdel commented Dec 17, 2018

Causes https://bugzilla.redhat.com/show_bug.cgi?id=1656003

Thanks to this change, every single element with miq-observe will now send change events twice.

EDIT: fixed in #5097

@ZitaNemeckova ZitaNemeckova deleted the fix_onfocus_radion_buttons branch December 18, 2018 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants