Skip to content

Commit e4bd1fc

Browse files
committed
contend with vector input
1 parent de2715d commit e4bd1fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/properties.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ property_choice <- function(options, allow_null = FALSE, default = NULL) {
2222
if (allow_null && is.null(value)) {
2323
return(character())
2424
}
25-
if (!is_string(value)) {
25+
if (!is_character(value)) {
2626
return(as_cli("must be a string, not {.obj_type_friendly {value}}"))
2727
}
28-
if (value %in% options) {
28+
if (all(value %in% options)) {
2929
return(character())
3030
}
3131
as_cli("must be one of {.or {.val {options}}}")
@@ -47,10 +47,10 @@ property_fontface <- function(allow_null = TRUE, default = NULL) {
4747
if (allow_null && is.null(value)) {
4848
return(character())
4949
}
50-
if (is_integerish(value) && value %in% 1:4) {
50+
if (is_integerish(value) && all(value %in% 1:4)) {
5151
return(character())
5252
}
53-
if (value %in% options) {
53+
if (all(value %in% options)) {
5454
return(character())
5555
}
5656
as_cli("must be one of {.or {.val {options}}}.")

0 commit comments

Comments
 (0)