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

Added highlight for selected line in checkbox #716

Merged
merged 2 commits into from
Aug 20, 2018
Merged

Added highlight for selected line in checkbox #716

merged 2 commits into from
Aug 20, 2018

Conversation

aliaksandr-yermalayeu
Copy link
Contributor

fixes #479

There is inconsistency between list and checkbox selected line. It is highlighted in list and ignored in checkbox module. It is hard to follow what item is currently selected, when there are to many similar items with checkboxes. This fix changes code in order to highlight selected line with cyan color.

@codecov
Copy link

codecov bot commented Aug 15, 2018

Codecov Report

Merging #716 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #716      +/-   ##
==========================================
+ Coverage   92.69%   92.69%   +<.01%     
==========================================
  Files          26       26              
  Lines        1040     1041       +1     
  Branches       19       19              
==========================================
+ Hits          964      965       +1     
  Misses         76       76
Impacted Files Coverage Δ
packages/inquirer/lib/prompts/checkbox.js 99% <100%> (+0.01%) ⬆️

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 1a79fbe...fc1c0e8. Read the comment docs.

var isSelected = i - separatorOffset === pointer;
output += isSelected ? chalk.cyan(figures.pointer) : ' ';
output += getCheckbox(choice.checked) + ' ' + choice.name;
var line = getCheckbox(choice.checked) + choice.name;
Copy link
Owner

Choose a reason for hiding this comment

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

When rewriting this line, the blank space between the checkbox and the option name has been removed (e.g. []Choice A vs [] Choice A)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My mistake. Blank space was restored in the latest commit.

@SBoudrias SBoudrias merged commit f94e5d0 into SBoudrias:master Aug 20, 2018
@SBoudrias
Copy link
Owner

Thanks!

@sergei-startsev
Copy link

@SBoudrias is there a chance to publish the changes?

@SBoudrias
Copy link
Owner

@sergei-startsev I wasn't personally in a hurry, but as you requested it I'll cut a release tonight.

@sergei-startsev
Copy link

@SBoudrias thanks for the release!

jdoyle65 pushed a commit to jdoyle65/Inquirer.js that referenced this pull request Jan 19, 2021
* Added highlight for selected line in checkbox

fixes SBoudrias#479

* Restored space between checkbox and option name
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.

Highlight current selection
3 participants