jrowen / rhandsontable

A htmlwidgets implementation of Handsontable.js
http://jrowen.github.io/rhandsontable/
Other
380 stars 147 forks source link

Issue when more than 1 character in dropdown #424

Open jhen1115 opened 1 year ago

jhen1115 commented 1 year ago

Hi,

There is a dropdown validator issue when more than 1 character in dropdown. For example,

rhandsontable(data.frame(char = rep("Ab", 2))) %>%
   hot_col(
      "char",
      type = "dropdown",
      source = "Ab"
)

The background of cells will be changed to red after the dropdown is opened. image

However, if the "Ab" is changed to "A", then the background of cells will not be changed after the dropdown is opened.

Now, the below validator argument is added to resolve the issue

validator = paste0(
   "function(value, callback) {",
   "   callback(value === 'Ab' ? true : false);",
   "}"
)

..., however, does anyone have better resolution for solving this issue?

Thank you