Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: repeater label display issues #1707

Closed
ramiy opened this issue May 10, 2017 · 0 comments
Closed

BUG: repeater label display issues #1707

ramiy opened this issue May 10, 2017 · 0 comments
Labels
bug Indicates a bug with one or multiple components. type/developer-api Indicates when a topic is related to the Developer API and Documentation.
Milestone

Comments

@ramiy
Copy link
Contributor

ramiy commented May 10, 2017

Description

When hiding the main label in a "REPEATER" control, it also hides the labels of the "SLIDER" control. I should mention that other control labels are not affected, only the slider is affected by the main repeater.

bug

Steps to reproduce

Add 'show_label' => false to the main REPEATER control:

$this->add_control(
	'content',
	[
		'label' => __( 'Content', 'press-elements' ),
		'type' => Controls_Manager::REPEATER,
		'show_label' => false,
		'fields' => array_values( $repeater->get_controls() ),
		'title_field' => '{{{ heading }}}',
		'default' => [
			[
				'heading' => __( 'Text 1', 'press-elements' ),
				'vertical_position' => [
					'size' => 20,
					'unit' => '%',
				],
				'horizontal_position' => [
					'size' => 40,
					'unit' => '%',
				],
			],
			[
				'heading' => __( 'Text 2', 'press-elements' ),
				'vertical_position' => [
					'size' => 80,
					'unit' => '%',
				],
				'horizontal_position' => [
					'size' => 60,
					'unit' => '%',
				],
			]
		]
	]
);

All the repeater sub elements that use Controls_Manager::SLIDER have hidden labels.

I tried to add 'show_label' => true, to repeater fields. It didn't helped.

$repeater = new Repeater();

$repeater->start_controls_tabs( 'content_repeater' );

$repeater->start_controls_tab( 'pointer', [ 'label' => __( 'Pointer', 'press-elements' ) ] );

$repeater->add_responsive_control(
	'horizontal_position',
	[
		'label' => __( 'Horizontal Position (%)', 'press-elements' ),
		'type' => Controls_Manager::SLIDER,
		'show_label' => true,
		'size_units' => [ '%' ],
		'range' => [
			'%' => [
				'min' => 1,
				'max' => 100,
			],
		],
		'default' => [
			'size' => 50,
			'unit' => '%',
		],
		'selectors' => [
			'{{WRAPPER}} {{CURRENT_ITEM}} .item' => 'left: {{SIZE}}{{UNIT}};',
		],
	]
);

$repeater->add_responsive_control(
	'vertical_position',
	[
		'label' => __( 'Vertical Position (%)', 'press-elements' ),
		'type' => Controls_Manager::SLIDER,
		'size_units' => [ '%' ],
		'range' => [
			'%' => [
				'min' => 1,
				'max' => 100,
			],
		],
		'default' => [
			'size' => 50,
			'unit' => '%',
		],
		'selectors' => [
			'{{WRAPPER}} {{CURRENT_ITEM}} .item' => 'top: {{SIZE}}{{UNIT}};',
		],
	]
);

$repeater->end_controls_tab();

$repeater->end_controls_tabs();

Environment

  • WP 4.7.4
  • Elementor 1.4.6
@arielk arielk added bug Indicates a bug with one or multiple components. type/developer-api Indicates when a topic is related to the Developer API and Documentation. labels May 12, 2017
@arielk arielk added this to the 1.5.0 milestone May 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates a bug with one or multiple components. type/developer-api Indicates when a topic is related to the Developer API and Documentation.
Projects
None yet
Development

No branches or pull requests

3 participants