Fairly straight forward,
If you configure both/either Prefix and Suffix as Optional, and then populate the configuration list, there is no option to allow a blank option (if they choose not to select an option, it defaults to the first option in the list). Even if you precursor the list with a space and ";" it defaults to the first option after the first semi-colon.


Thanks for reporting, internal ticket created MAGETWO-60288
@spyrule, thank you for your report.
We've created internal ticket(s) MAGETWO-60288 to track progress on the issue.
Working on this.
I solved parts of this in #11462. An empty line is added automatically if the field is set to "optional".
Unfortunately, I wasn't able to fix the default option selection in the checkout; it still always selects the first option with a value, it should select the first option at all.
I am pretty sure that the relevant code is in app/code/Magento/Ui/view/base/web/js/form/element/select.js (plus I modified app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js::optionNodeFromArray where I added the line option.setAttribute('data-title', ''); before line 222; this seems like a step in the right direction).
@benmarks has sent me a hint to a possible solution: https://stackoverflow.com/questions/15481380/knockout-js-setting-an-empty-selection. I added the optionsCaption parameter in https://github.com/magento/magento2/blob/9c14af7a97bcf338662de365d2613c7ca9dbf8c6/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php#L131, but it gets lost somewhere in https://github.com/magento/magento2/blob/9c14af7a97bcf338662de365d2613c7ca9dbf8c6/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php#L143. To be honest, that method is a nightmare to debug and not exactly well readable so I still didn't get it running.
Hi @spyrule. Thank you for your report.
The issue has been fixed in magento/magento2#11462 by @avstudnitz in 2.2-develop branch
Related commit(s):
The fix will be available with the upcoming patch release.
Hi @spyrule. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1297 by @magento-engcom-team in 2.3-develop branch
Related commit(s):
The fix will be available with the upcoming patch release.
What version is this being added in?
I want to make prefix required field, but don't want an option selected by default. e..g show blank or "Select title"
Most helpful comment
@benmarks has sent me a hint to a possible solution: https://stackoverflow.com/questions/15481380/knockout-js-setting-an-empty-selection. I added the
optionsCaptionparameter in https://github.com/magento/magento2/blob/9c14af7a97bcf338662de365d2613c7ca9dbf8c6/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php#L131, but it gets lost somewhere in https://github.com/magento/magento2/blob/9c14af7a97bcf338662de365d2613c7ca9dbf8c6/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php#L143. To be honest, that method is a nightmare to debug and not exactly well readable so I still didn't get it running.