SteveSanderson/knockout — Issue #205: Make optionsCaption handle observables
Author: barclayadam
Created: 2011-11-16 11:32:06+00:00
State: open

Steve,

We have the need to display an option caption that changes based on the state of the system (e.g. 'Loading' -> 'Please Select'). To achieve this I've made a change to the options binding handler to unwrap the optionsCaption observable:

option.innerHTML = allBindings['optionsCaption'];

becomes

option.innerHTML = ko.utils.unwrapObservable(allBindings['optionsCaption']);

on line 213 of src/binding/defaultBindings.js

This should be a non-breaking change that can hopefully be slipped into the 1.3.0 release if that ship has not already sailed?

If required I can create a pull request when I can find the time.

Thanks,
Adam