• Resolved ianth007

    (@ianth007)


    As you can see where it says ‘select a rating’ there is a small arrow which is covering part of the word.
    Is there any way to ‘clean’ this up or get rid of the dropdown option, please?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Add this code to your site’s stylesheet
    This is not a plugin problem, but your template problem.

    .glsr-review-form .bgtfw-select
     {
        padding: 12px 35px 12px 12px;
     }
    .glsr-review-form .bgtfw-wrap-select:after{
         display: none!important;
     }
    • This reply was modified 4 years, 5 months ago by pavel8289.
    Plugin Author Gemini Labs

    (@geminilabs)

    Ah, your theme is using the BoldGrid Theme Framework which uses my float-labels.js library.

    float-labels.js provides an exclude option which is meant to be used to prevent this kind of problem. The default exclude class is .no-label, but I can see that the BoldGrid Theme Framework overwrites that parameter with .comment-form-rating #rating, .widget_categories .postform, .quantity .qty, so unfortunately it’s not as simple as using a Site Reviews hook to add the .no-label class to the hidden rating dropdown.

    You have a three options:

    1. Use some custom CSS to hide the SELECT element
    2. Use some custom javascript to undo the Float Labels on the rating dropdown:

    document.addEventListener('DOMContentLoaded', function () {
        var floatlabels = document.querySelectorAll('.glsr-form .bgtfw-wrap-select');
        floatlabels.forEach(function (floatlabel) {
            if (floatlabel.querySelector('.glsr-star-rating')) {
                var fragment = document.createDocumentFragment();
                while (floatlabel.firstElementChild) {
                    var el = floatlabel.firstElementChild;
                    var classes = el.className.split(' ').filter(function (val) {
                        return 0 !== val.lastIndexOf('bgtfw-', 0);
                    });
                    el.className = classes.join(' ').trim();
                    fragment.appendChild(el);
                }
                floatlabel.parentElement.replaceChild(fragment, floatlabel);
            }
        });
    });

    3. If you built the theme yourself, you can edit the front-end.js file and add the .glsr-star-rating class to the selectors variable which will exclude it from the float-labels.js script.

    And if you want to fix the positioning and font-size of the rating and toggle labels, use this CSS:

    .gl-star-rating {
        flex-wrap: wrap;
    }
    .gl-star-rating label {
        font-size: 1.6rem !important;
        width: 100%;
    }
    .glsr-toggle {
        font-size: 1.6rem;
    }
    .glsr-toggle label {
        font-size: 1.6rem !important;
        padding: 0;
    }
    • This reply was modified 4 years, 5 months ago by Gemini Labs.
    Thread Starter ianth007

    (@ianth007)

    That’s brilliant, thank you so much 🙂

    Whereabouts (file-wise etc.) would I put either of these solutions, please?

    I did add the

    document.addEventListener('DOMContentLoaded', function () {
        var floatlabels = document.querySelectorAll('.glsr-form .bgtfw-wrap-select');
        floatlabels.forEach(function (floatlabel) {
            if (floatlabel.querySelector('.glsr-star-rating')) {
                var fragment = document.createDocumentFragment();
                while (floatlabel.firstElementChild) {
                    var el = floatlabel.firstElementChild;
                    var classes = el.className.split(' ').filter(function (val) {
                        return 0 !== val.lastIndexOf('bgtfw-', 0);
                    });
                    el.className = classes.join(' ').trim();
                    fragment.appendChild(el);
                }
                floatlabel.parentElement.replaceChild(fragment, floatlabel);
            }
        });
    });

    to your ‘float-labels.js’ folder at line 37… but it didn’t seem to make any difference.
    Is there something else that I also need to do, please?

    Tried to attach a screenshot to show you where the folder is placed – but unfortunately can’t attach.

    Thank you for your help.

    Plugin Author Gemini Labs

    (@geminilabs)

    No, you don’t add it to the float-labels script.

    If you are opting for solution #2, then add the Javascript snippet to either your theme’s javascript file, or use a plugin such as Custom CSS and JavaScript.

    If you are opting for solution #3 (recommended if you have built your theme), then ignore #2 and follow the directions in #3.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Review form layout not displaying properly’ is closed to new replies.