Fixed xf:numberbox inside field-adder duplicates +/- fields

DragonByte Tech

Well-known member
Affected version
2.0.12 & 2.1.0 Beta 5
190678

HTML:
<xf:formrow rowtype="input"
                        label="{{ phrase('dbtech_ecommerce_commission_applicable_products') }}"
                        explain="{{ phrase('dbtech_ecommerce_commission_applicable_products_explain') }}">

                <ul class="listPlain inputPair-container">
                    <xf:foreach loop="$commission.Products" value="$map" i="$i">
                        <li class="inputPair">
                            <div class="inputGroup">
                                <xf:macro template="public:dbtech_ecommerce_product_macros" name="product_select"
                                          arg-inputName="product_commissions[{$i}][product_id]" arg-productsByCategory="{$productsByCategory}"
                                          arg-productId="{$map.product_id}" arg-row="{{ false }}" arg-class="filterBlock-input"
                                          arg-includeBlank="{{ false }}" arg-includeNone="{{ true }}"
                                />

                                <span class="inputGroup-splitter"></span>

                                <xf:numberbox name="product_commissions[{$i}][commission_value]" min="0" value="{$map.commission_value}"
                                              step="any" required="{{ false }}" />

                                <span class="inputGroup-splitter"></span>

                                <xf:select name="product_commissions[{$i}][commission_type]" value="{$map.commission_type}" class="filterBlock-input">
                                    <xf:option value="percent">{{ phrase('dbtech_ecommerce_percent') }}</xf:option>
                                    <xf:option value="value">{$xf.options.dbtechEcommerceCurrency}</xf:option>
                                </xf:select>
                            </div>
                        </li>
                    </xf:foreach>
                    <li class="inputPair" data-xf-init="field-adder" data-increment-format="product_commissions[{counter}]">
                        <div class="inputGroup">
                            <xf:macro template="public:dbtech_ecommerce_product_macros" name="product_select"
                                      arg-inputName="product_commissions[{$nextCounter}][product_id]" arg-productsByCategory="{$productsByCategory}"
                                      arg-productId="" arg-row="{{ false }}" arg-class="filterBlock-input"
                                      arg-includeBlank="{{ false }}" arg-includeNone="{{ true }}"
                            />

                            <span class="inputGroup-splitter"></span>

                            <xf:numberbox name="product_commissions[{$nextCounter}][commission_value]" min="0"
                                          step="any" required="{{ false }}" />

                            <span class="inputGroup-splitter"></span>

                            <xf:select name="product_commissions[{$nextCounter}][commission_type]" class="filterBlock-input">
                                <xf:option value="percent">{{ phrase('dbtech_ecommerce_percent') }}</xf:option>
                                <xf:option value="value">{$xf.options.dbtechEcommerceCurrency}</xf:option>
                            </xf:select>
                        </div>
                    </li>
                </ul>
            </xf:formrow>


Fillip
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.0 B7/RC1).

Change log:
Prevent numberbox up/down buttons from being duplicated when the existing HTML structure is duplicated (such as via field adder) and re-activated.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom