ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
925 stars 220 forks source link

Small error with Slider option type #3383

Closed trongcong closed 6 years ago

trongcong commented 6 years ago

There seems to be a slight bug with "slider options type", the slider bar does not match the slider grid below, hope you can fix it.

Screen shot: https://prnt.sc/jkbdcz

My code:

array( 'post_related_limit' => array( 'type' => 'slider', 'value' => 4, 'properties' => array( 'min' => 1, 'max' => 6, 'step' => 1, // Set slider step. Always > 0. Could be fractional. ), 'label' => ( 'Post related limit', '{domain}' ), 'desc' => ( 'Post related limit (min => 1 | max => 6)', '{domain}' ), ), )

ViorelEremia commented 6 years ago

We use ion.rangeSlider I opened an issue there: https://github.com/IonDen/ion.rangeSlider/issues/559. Try to use it in this way :

'post_related_limit' => array(
    'type'       => 'slider',
    'value'      => 4,
    'properties' => array(
        'step'   => 1, // Set slider step. Always > 0. Could be fractional.
        'values' => array( 1, 2, 3, 4, 5, 6 )
    ),
    'label'      => __( 'Post related limit', '{domain}' ),
    'desc'       => __( 'Post related limit (min => 1 | max => 6)', '{domain}' ),
),
trongcong commented 6 years ago

Thank you @ViorelEremia
I hope they will be fixed it soon

ViorelEremia commented 6 years ago

You can use and another way:

'post_related_limit' => array(
    'type'       => 'slider',
    'value'      => 4,
    'properties' => array(
        'step'      => 1, // Set slider step. Always > 0. Could be fractional.
        'min'       => 1,
        'max'       => 6,
        //'values'    => array( 1, 2, 3, 4, 5, 6 ),
        'grid_snap' => 'true'
    ),
    'label'      => __( 'Post related limit', '{domain}' ),
    'desc'       => __( 'Post related limit (min => 1 | max => 6)', '{domain}' ),
),

I tested it and is working that is happening only for the max value of 6 i tested with bigger and lower and is working fine. I close the issue for now but I'll watch it when it's fixed in the original repository.