diff --git a/src/components/field/__snapshots__/test.js.snap b/src/components/field/__snapshots__/test.js.snap index 1cc2a87..0e80e92 100644 --- a/src/components/field/__snapshots__/test.js.snap +++ b/src/components/field/__snapshots__/test.js.snap @@ -249,6 +249,7 @@ exports[`renders accessory 1`] = ` value="" /> `; +exports[`renders left accessory 1`] = ` + + + + + test + + + + + + + + + + + + + + + + + + + + +`; + exports[`renders multiline value 1`] = ` - {renderAccessory()} - + + {renderAccessoryComponent()} + ); } @@ -451,6 +453,14 @@ export default class TextField extends PureComponent { fontSize: titleFontSize, }; + + let accessoryStyle = { + opacity: focus.interpolate({ + inputRange: [-1, 0, 1], + outputRange: [1, active ? 1 : 0, 1], + }), + }; + let titleFontSizeMultiplier = this.props.helpersNumberOfLines; let helperContainerStyle = { @@ -519,6 +529,7 @@ export default class TextField extends PureComponent { + {this.renderAccessory('left', accessoryStyle)} {this.renderAffix('prefix', active, focused)} {this.renderAffix('suffix', active, focused)} - {this.renderAccessory()} + {this.renderAccessory('right')} diff --git a/src/components/field/test.js b/src/components/field/test.js index 73b390f..4e1df0a 100644 --- a/src/components/field/test.js +++ b/src/components/field/test.js @@ -127,3 +127,14 @@ it('renders accessory', () => { expect(field) .toMatchSnapshot(); }); + +it('renders left accessory', () => { + let render = () => + + let field = renderer + .create() + .toJSON(); + + expect(field) + .toMatchSnapshot(); +}); \ No newline at end of file