@@ -100,7 +100,7 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
100100 part ="decrease-button "
101101 on-click ="_decreaseValue "
102102 on-touchend ="_decreaseButtonTouchend "
103- hidden$ ="[[!hasControls]] "
103+ hidden$ ="[[!_isStepButtonVisible( hasControls, stepButtonsVisible) ]] "
104104 aria-hidden ="true "
105105 slot ="prefix "
106106 > </ div >
@@ -113,7 +113,7 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
113113 part ="increase-button "
114114 on-click ="_increaseValue "
115115 on-touchend ="_increaseButtonTouchend "
116- hidden$ ="[[!hasControls]] "
116+ hidden$ ="[[!_isStepButtonVisible( hasControls, stepButtonsVisible) ]] "
117117 aria-hidden ="true "
118118 slot ="suffix "
119119 > </ div >
@@ -137,13 +137,25 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
137137 /**
138138 * Set to true to display value increase/decrease controls.
139139 * @attr {boolean} has-controls
140+ * @deprecated since 23.3.
141+ * Use [`stepButtonsVisible`](#/elements/vaadin-number-field#property-stepButtonsVisible) instead
140142 */
141143 hasControls : {
142144 type : Boolean ,
143145 value : false ,
144146 reflectToAttribute : true ,
145147 } ,
146148
149+ /**
150+ * Set to true to show increase/decrease buttons.
151+ * @attr {boolean} step-buttons-visible
152+ */
153+ stepButtonsVisible : {
154+ type : Boolean ,
155+ value : false ,
156+ reflectToAttribute : true ,
157+ } ,
158+
147159 /**
148160 * The minimum value of the field.
149161 */
@@ -429,6 +441,16 @@ export class NumberField extends InputFieldMixin(ThemableMixin(ElementMixin(Poly
429441
430442 super . _onKeyDown ( event ) ;
431443 }
444+
445+ /**
446+ * Determines whether to hide the increase / decrease buttons based on the
447+ * deprecated `hasControls` property, and the replacement `stepButtonsVisible`
448+ * property
449+ * @private
450+ */
451+ _isStepButtonVisible ( hasControls , stepButtonsVisible ) {
452+ return hasControls || stepButtonsVisible ;
453+ }
432454}
433455
434456customElements . define ( NumberField . is , NumberField ) ;
0 commit comments