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

Adjust input field behavior to keep placeholder text visible #6406

Merged
merged 5 commits into from
May 16, 2024

Conversation

anicyne
Copy link
Contributor

@anicyne anicyne commented May 8, 2024

☑️ Definition of Done checklist

  • Meaningful title for the release notes
  • Pull request is linked to a problem
  • All changes relate to the problem
  • A11y tests performed successfully or not relevant
  • Manual test performed successfully (by reviewer) or not relevant

@anicyne anicyne self-assigned this May 8, 2024
Copy link
Contributor

github-actions bot commented May 8, 2024

@@ -130,6 +137,8 @@ export class KolInputText implements API {
value={this.state._value as string}
{...this.controller.onFacade}
onChange={this.onChange}
onFocus={console.log}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log entfernen

@@ -40,6 +40,9 @@ export class KolInputText implements API {
private ref?: HTMLInputElement;
private oldValue?: string;

@State()
private showPlaceholder = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showPlaceholder wird nie false

Copy link
Contributor

@deleonio deleonio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anicyne / @laske185

Könnt Ihr mal schauen, ob das "einfacher" ohne State und Methode umgesetzt werden kann?

Einfach:

	maxlength={this.state._maxLength}
	name={this.state._name}
	pattern={this.state._pattern}
	placeholder={this.ref?.value === '' || this.ref?.value === undefined ? this.state._placeholder : undefined}
	readOnly={this.state._readOnly}
	required={this.state._required}
	size={this.state._size}

(event.target as HTMLInputElement).value === '' ? (this.showPlaceholder = true) : (this.showPlaceholder = false);
};

private readonly SetShowPlaceholder = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kleine Korrektur: Methoden-Namen beginnen immer mit einem kleinen Buchstaben.

@anicyne anicyne requested a review from deleonio May 14, 2024 09:35
@sdvg sdvg changed the title (#6186) Adjust input field behavior to keep placeholder text visible Adjust input field behavior to keep placeholder text visible May 15, 2024
@deleonio
Copy link
Contributor

@AntnSaj

		/**
		 * Beim Screenreader NVDA wird der Placeholder mit
		 * vorgelesen. Somit kann es vorkommen, dass das
		 * Label und der Placeholder vorgelesen werden.
		 *
		 * Aufgrund dessen, dass das Label immer vorgelesen
		 * werden muss, kann das zusätzliche Vorlesen des
		 * Placeholders störend sein.
		 *
		 * Damit beim Fokussieren das "doppelte" vorlesen
		 * vermieden werden kann, wird der Placeholder für
		 * den fokussierten Feldstatus entfernt.
		 *
		 * Hinweis: Für alle Nutzenden müssen alle darge-
		 *          stellten Inhalte, also auch der Place-
		 *          holder, gleichermaßen zugänglich sein.
		 *          Das oben beschriebene Handling erfüllt
		 *          diese Anforderung nicht.
		 */

@AntnSaj
Copy link

AntnSaj commented May 16, 2024

Auf Barrierefreiheit getestet. Es wurde kein Fehler hinsichtlich Barrierefreiheit gefunden

Copy link
Contributor

@deleonio deleonio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @anicyne

Copy link
Contributor

@deleonio deleonio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @anicyne - siehe changed files ,.. Interessanter historischer Kommentar

@deleonio deleonio merged commit 6472d11 into release/1.7 May 16, 2024
3 of 5 checks passed
@deleonio deleonio deleted the 6186-v1-update-placeholder-behavior branch May 16, 2024 11:14
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: 🚹 A11y-Test
Development

Successfully merging this pull request may close these issues.

💡 Hinweis: Placeholder Text in Eingabfelder verschwindet erst bei Tippen
4 participants