Restrict the typed value to an option in the hidden dropdown on blur #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are 3 commits in this pull request. I'll try to explain a little about each:
Changed all tabs to 2 spaces
This commit only fixes whitespace formatting. I noticed that 2 spaces were used in most cases. So, I switched all tabs to 2 spaces. Specifically, this makes it a lot nicer to look at on GitHub.com.
Revert to previously selected value when the field loses focus and has an invalid value
This is the main reason for these commits. If you accept this pull request, this table describes the behavior:
When I say, "The previous valid value is inserted," I mean that the currently selected option from the hidden dropdown is inserted.
Fixed bug where 'copy-attributes-to-text-field': false caused the text field to never be inserted into the dom
While working on this, I noticed that the statements that actually add the text field to the DOM were inside the if statement that only executes when copy-attributes-to-text-field is true. So, I tested it and sure enough, the text field never appears on the page if that setting is set to false. Normally, I would put this in as a separate pull request, but since it affects the same lines of code, I thought this would be easier.
I am very willing to make tweaks or discuss this further if you have questions! Let me know. This addresses issue #16.