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

Fix #6016: Limited the selection area of multiple choice option #6029

Merged
merged 2 commits into from
Jan 3, 2019

Conversation

mighty-phoenix
Copy link
Contributor

@mighty-phoenix mighty-phoenix commented Dec 24, 2018

Explanation

Fixes #6016: Changed the width property in css of multiple choice option from 100% to auto.
By doing this, the selection area is limited to the radio button and text. This prevents accidental selection of an option by clicking somewhere on the div where no text is present.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The linter/Karma presubmit checks have passed.
    • These should run automatically, but if not, you can manually trigger them locally using python scripts/pre_commit_linter.py and bash scripts/run_frontend_tests.sh.
  • The PR is made from a branch that's not called "develop".
  • The PR follows the style guide.
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer.
    • If you're not sure who the appropriate reviewer is, please assign to the issue's "owner" -- see the "talk-to" label on the issue.

@mighty-phoenix mighty-phoenix requested review from nithusha21 and bansalnitish and removed request for nithusha21 December 24, 2018 19:56
@bansalnitish bansalnitish self-assigned this Dec 24, 2018
@codecov-io
Copy link

codecov-io commented Dec 24, 2018

Codecov Report

Merging #6029 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6029   +/-   ##
=======================================
  Coverage     45.3%   45.3%           
=======================================
  Files          520     520           
  Lines        30667   30667           
  Branches      4597    4597           
=======================================
  Hits         13893   13893           
  Misses       16774   16774

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef0bd13...9990be9. Read the comment docs.

@nithusha21
Copy link
Contributor

Did you test this on Firefox to make sure that the behavior stated in the comment is retained after changing the width?

@mighty-phoenix
Copy link
Contributor Author

@nithusha21 yes I did. Thanks for asking.

Copy link
Contributor

@bansalnitish bansalnitish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rakshitkumarcse This looks good to me, but I have a doubt.

afa

If you have an item in item selection (say) which extends over second line but doesn't fills the second line completely then also your PR selects the radio button for the entire width (see the screenshot for the reference). I'm not sure whether this is expected, though I'm satisfied with the behaviour.

@nithusha21, @DubeySandeep what do you say?

@mighty-phoenix
Copy link
Contributor Author

mighty-phoenix commented Dec 25, 2018

@bansalnitish Thanks for the review.
I believe the expected behavior should have been otherwise(i.e. entire width shouldn't be selected). However, due to limitations of html and css, a div(or in that case any container) cannot be irregularly shaped. So, I believe that the expected behavior can't be achieved in multi lined choices. However, this PR will serve the purpose for single line multiple choice interactions.
Thanks!

@mighty-phoenix
Copy link
Contributor Author

@bansalnitish Can you think of any way this can be dealt with in a better way?
Thanks.

@bansalnitish
Copy link
Contributor

To me personally, this looks good. Lets wait for other folks to give there opinion.
Thanks

@mighty-phoenix
Copy link
Contributor Author

@bansalnitish Alright. Thanks.

@@ -8,7 +8,8 @@
color: #0D48A1;
text-align: left;
/* This is needed so that images stay bounded by the container in Firefox. */
width: 100%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking about the comment on line 10.

Copy link
Contributor Author

@mighty-phoenix mighty-phoenix Dec 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I know. The comment stands correct now as well. I have tested it.
Thanks!

@nithusha21
Copy link
Contributor

Can we change the mouse pointer from an arrow to the "click" icon? That should clear up some confusion.

@mighty-phoenix
Copy link
Contributor Author

@nithusha21 I find your suggestion pretty good.
Should I change the mouse pointer to arrow?

@mighty-phoenix
Copy link
Contributor Author

@nithusha21 I just noticed one more thing. I see an arrow itself in the selection area. I am using firefox.
@bansalnitish Which browser are you using?

@bansalnitish
Copy link
Contributor

bansalnitish commented Dec 27, 2018

@nithusha21 If we use the click icon, still we'll get the same issue. The click icon would appear in the second line, where there is no text (as in screenshot above).

Also, hovering the mouse over the text and radio button highlights the radio button, isn't this itself indicating something like click?

@rakshitkumarcse I used chrome. (I'll test this on firefox too.)

@mighty-phoenix
Copy link
Contributor Author

@bansalnitish I agree with your views.

@mighty-phoenix
Copy link
Contributor Author

@bansalnitish What do we finally do about this?

@DubeySandeep
Copy link
Member

If you have an item in item selection (say) which extends over second line but doesn't fills the second line completely then also your PR selects the radio button for the entire width (see the screenshot for the reference). I'm not sure whether this is expected, though I'm satisfied with the behaviour.

@bansalnitish, It's fine to have this behaviour there's nothing wrong here!

@DubeySandeep
Copy link
Member

DubeySandeep commented Jan 3, 2019

@rakshitkumarcse, this can be merged after testing images as multiple choice option in the interaction (on Firefox). So let's wait for @bansalnitish UI review.

@mighty-phoenix
Copy link
Contributor Author

@DubeySandeep Sure. Thanks for your views.
Although I have tested the interaction with images, it would be better if @bansalnitish does a final review as well.
Thanks!

Copy link
Contributor

@bansalnitish bansalnitish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bansalnitish bansalnitish merged commit abaed1f into oppia:develop Jan 3, 2019
@mighty-phoenix mighty-phoenix deleted the fix_width_multiple branch January 3, 2019 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In Multiple-choice-question the radio buttons should probably not have detection at 100% width
5 participants