i'm new to front-end technologies.i need to get TextBox value into the Tool-tip.in code TextBox max length is 30.but in textBox area not fit to that characters length.then need to decide using ToolTip and hover over the partially display value.
following is my code
<Tooltip title={########}>
<input
type="text"
maxLength="30"
name="displayName"
placeholder=""
onChange={displayNameChange.bind(this, f)}
className="form-control input-display-name"
/>
</Tooltip>
need to get that textBox value in to title={########}.
Appreciate your help.
thanks,
You can try following approach:
As an add on, you can try following as well:
This will reduce redundant information.
Following is a sample: JSFiddle
const Tooltip = (props) => {
const [ inputValue, setInputValue ] = useState('');
function handleKeyup(event) {
setInputValue( event.target.value );
}
return (
<div title={ inputValue.length > props.visibleLen ? inputValue : null }>
<input value={inputValue} onChange={ handleKeyup } />
</div>
)
}