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

fixed dropdown when multiple inputs are needed #310

Merged
merged 2 commits into from
Sep 28, 2020

Conversation

dokato
Copy link
Contributor

@dokato dokato commented Sep 15, 2020

Fixes #308 .
Contributes to #313

A bit hacky, but this should help.

DoD

  • Major project work has a corresponding task. If there’s no task for what you are doing, create it. Each task needs to be well defined and described.

  • Change has been tested (manually or with automated tests), everything runs correctly and works as expected. No existing functionality is broken.

  • No new error or warning messages are introduced.

  • All interaction with a semantic functions, examples and docs are written from the perspective of the person using or receiving it. They are understandable and helpful to this person.

  • If the change affects code or repo sctructure, README, documentation and code comments should be updated.

  • All code has been peer-reviewed before merging into any main branch.

  • All changes have been merged into the main branch we use for development (develop).

  • Continuous integration checks (linter, unit tests) are configured and passed.

  • Unit tests added for all new or changed logic.

  • All task requirements satisfied. The reviewer is responsible to verify each aspect of the task.

  • Any added or touched code follows our style-guide.

Copy link
Contributor

@krystian8207 krystian8207 left a comment

Choose a reason for hiding this comment

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

ptal at one comment

R/dropdown.R Outdated
if (!is.null(value)) value <- paste(as.character(value), collapse = ",")
if (!is.null(value)) {
value <- paste(as.character(value), collapse = ",")
value <- paste0(value, ",")
Copy link
Contributor

Choose a reason for hiding this comment

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

@dokato why this change solves an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is due to how the split works in JS: https://github.com/Appsilon/shiny.semantic/blob/develop/inst/www/shiny-semantic-dropdown.js#L28 otherwise it is not treated as an array.

@DamianRodziewicz
Copy link
Member

@dokato I think that the fix should be done in a different place. It looks like javascript needs to be updated to treat a single value correctly instead of hacking in an empty value as a second argument in R.

Copy link
Member

@DamianRodziewicz DamianRodziewicz left a comment

Choose a reason for hiding this comment

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

LGTM, tested

@DamianRodziewicz
Copy link
Member

Thank you for the fix @krystian8207, works well.

As a note: Fomantic automatically sets the 'active' class so it is not needed.

@DamianRodziewicz DamianRodziewicz merged commit c218a4e into develop Sep 28, 2020
@DamianRodziewicz DamianRodziewicz deleted the fix_multiple_select branch September 28, 2020 14:13
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.

selectInput doesn't recognize a single value being selected
3 participants