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

Date Input supports typing characters and deleting selected date #919

Open
MirelaPaun opened this issue Jan 9, 2020 · 2 comments
Open

Comments

@MirelaPaun
Copy link

MirelaPaun commented Jan 9, 2020

Describe the bug
Date Input supports typing characters and deleting selected date by pressing DELETE or BACKSPACE keys from the keyboard

To reproduce

  • Display an input type date
<form data-ts="Form">
	<fieldset>
		<label>
			<span>Date</span>
			<input type="date"
				value="2015-01-01"
				min="2014-01-01"
				max="2016-01-01"/>
		</label>
	</fieldset>
</form>

Expected behavior
Date Input shouldn't be manipulated, once a date is selected, the input should be readonly.

Framework usage
React 16.8.6
TS UI Comp 12.3.6

Desktop (please complete the following information):

  • Browser: Chrome

Additional context
Add any other context about the problem here.
image

@apasare
Copy link
Contributor

apasare commented Jan 15, 2021

The reason why this is happening is because when you click on a label the focus is provided to the label's first visible child input element. In this case the first visible element is the original input, which is pseudo-hidden(width: 0; height: 0) - you can check this by typing document.activeElement into console.

One quick solution on your side, until this is fixed in ts-ui, would be to add the following css rule to properly hide the element:

.ts-form .ts-dateinput {
	display: none;
}

@MirelaPaun
Copy link
Author

@lauratanase please check this issue too. It seems that other teams are also having issues with input type date. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants