diff --git a/packages/input/src/LionInput.js b/packages/input/src/LionInput.js index 2552c9bdd..31b9905b9 100644 --- a/packages/input/src/LionInput.js +++ b/packages/input/src/LionInput.js @@ -25,6 +25,14 @@ export class LionInput extends LionField { }; } + get delegations() { + return { + ...super.delegations, + properties: [...super.delegations.properties, 'step'], + attributes: [...super.delegations.attributes, 'step'], + }; + } + get slots() { return { ...super.slots, diff --git a/packages/input/test/lion-input.test.js b/packages/input/test/lion-input.test.js index 01cdbb599..c144f4517 100644 --- a/packages/input/test/lion-input.test.js +++ b/packages/input/test/lion-input.test.js @@ -14,6 +14,14 @@ describe('', () => { expect(el.inputElement.readOnly).to.equal(false); }); + it('delegates "step" attribute and property', async () => { + const el = await fixture(``); + expect(el.inputElement.step).to.equal('0.01'); + // TODO: activate when DelegateMixin is refactored + // const el2 = await fixture(``); + // expect(el2.inputElement.step).to.equal('0.02'); + }); + it('automatically creates an element if not provided by user', async () => { const el = await fixture(``); expect(el.querySelector('input')).to.equal(el.inputElement);