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

Allow tag query $*Class() methods to no-op on length 0 inputs #236

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

schloerke
Copy link
Collaborator

@schloerke schloerke commented Apr 22, 2021

Fixes #216

Also works with character(0) inputs (or any length 0 inputs)


Moved the $hasClass() method down so that the method order is "add, empty-like, has", similar to the attr method on tagQuery()

@schloerke schloerke requested a review from cpsievert April 22, 2021 19:11
R/tag_query.R Outdated Show resolved Hide resolved
@schloerke schloerke merged commit 0f95558 into master Apr 22, 2021
@schloerke schloerke deleted the tag_query_add_null_class branch April 22, 2021 19:30
schloerke added a commit that referenced this pull request Apr 22, 2021
* master:
  Allow tag query `$*Class()` methods to no-op on length 0 inputs (#236)
schloerke added a commit that referenced this pull request May 4, 2021
* master:
  `tagQuery()`: Rename`$root()` to `$allTags()`, `$selected()` to `$selectedTags()`; Print `$selectedTags()` like a `list()` (#230)
  tagQuery(): Rebuild less often and do not check for tag env cycles; Rename `$reset()` -> `$resetSelected()` (#235)
  Bump rlang dev version
  Revert "Return invisibly when not creating a new tagQuery() object (#228)"
  Allow tag query `$*Class()` methods to no-op on length 0 inputs (#236)
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.

tagQuery()'s $addClass() should allow NULL values
2 participants