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

Image.getAlt() not working if alt text set by constructor #15756

Closed
craigwebb-xft opened this issue Jan 25, 2023 · 5 comments · Fixed by #15757
Closed

Image.getAlt() not working if alt text set by constructor #15756

craigwebb-xft opened this issue Jan 25, 2023 · 5 comments · Fixed by #15757

Comments

@craigwebb-xft
Copy link

Description of the bug

Create a new Image with alt text:
Image image = new Image( "http://www.something.com" , "Some Alt Text" )

Then test getAlt():
assertEquals( "Some Alt Text" , image.getAlt().get() )
throws a java.util.NoSuchElementException: No value present

Related to the change for #14880

If setAlt() is used, then getAlt() works correctly.
I would expect setting the Alt text to be the same whether the constructor is used or the setAlt() is used.

Expected behavior

getAlt() should return the alt text, regardless of whether the constructor or the setAlt() was used.

Minimal reproducible example

See description of the bug

Versions

  • Vaadin / Flow version: 23.3
  • Java version: 11
  • OS version: Windows 10
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):
@craigwebb-xft
Copy link
Author

Thanks @Artur- Your commit looks good.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.0.0.alpha10 and is also targeting the upcoming stable 24.0.0 version.

@craigwebb-xft
Copy link
Author

Can this fix be added to Vaadin 23?

@mshabarov
Copy link
Contributor

@craigwebb-xft sorry for a late answer, unfortunately we got no notifications of this issue updates, so missed your request.
But luckily this pops up through the another ticket :)

Anyway, I've triggered a cherry pick of this fix into Flow 23.3 series, so hopefully this will be merged soon and released in the next maintainance patch.

vaadin-bot added a commit that referenced this issue Oct 2, 2023
Fixes #15756

Co-authored-by: Artur <artur@vaadin.com>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 23.3.26.

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

Successfully merging a pull request may close this issue.

3 participants