• Hi, since last update the option to add addtional details i properties isn’t working.

    anyone experiencing this? any idea how to solve it?

    kind regards

Viewing 1 replies (of 1 total)
  • brunods

    (@brunods)

    Hi, same here.

    It seems that the eventlisteners were lost or I don’t know how they were managed.

    For now you can paste this into the console as a temporary solution, but you must do it every time you reload the page.

    For the “+ Add more” button:

    document.querySelector('.button-secondary').addEventListener('click', function() {
    const tbody = this.closest('div.gsf-field').querySelector('tbody');
    const index = tbody.querySelectorAll('tr').length;
    const newRow =
    <br> <tr><br> <td class="sort"><span><i class="dashicons dashicons-menu"></i></span></td><br> <td class="title"><input type="text" name="real_estate_additional_feature_title[${index}]" value=""></td><br> <td class="value"><input type="text" name="real_estate_additional_feature_value[${index}]" value=""></td><br> <td class="remove"><i class="dashicons dashicons-dismiss"></i></td><br> </tr><br>;
    tbody.insertAdjacentHTML('beforeend', newRow);
    });

    For the “X” (delete) button:

    document.addEventListener('click', function(e) {
    if (e.target.classList.contains('dashicons-dismiss')) {
    const row = e.target.closest('tr');
    const tbody = row.closest('tbody');
    const rows = tbody.querySelectorAll('tr');
    if (rows.length > 1) {
    // Remove the row if there are more than 1 rows
    row.remove();
    } else {
    // Clear the inputs if it's the only row
    row.querySelector('.title input').value = '';
    row.querySelector('.value input').value = '';
    }
    }
    });
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.