[select] Return StringRef from current_option() (#13095)

This commit is contained in:
J. Nick Koston
2026-01-11 17:40:43 -10:00
committed by GitHub
parent eeeae53f76
commit 23f9f70b71
12 changed files with 68 additions and 23 deletions
+3 -1
View File
@@ -38,7 +38,9 @@ void Select::publish_state(size_t index) {
#endif
}
const char *Select::current_option() const { return this->has_state() ? this->option_at(this->active_index_) : ""; }
StringRef Select::current_option() const {
return this->has_state() ? StringRef(this->option_at(this->active_index_)) : StringRef();
}
void Select::add_on_state_callback(std::function<void(size_t)> &&callback) {
this->state_callback_.add(std::move(callback));