Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

select: label not visible when using md-selected-text #12091

Open
ewahner opened this issue Apr 20, 2021 · 2 comments
Open

select: label not visible when using md-selected-text #12091

ewahner opened this issue Apr 20, 2021 · 2 comments
Assignees
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community needs triage Issues that need initial triage

Comments

@ewahner
Copy link

ewahner commented Apr 20, 2021

AngularJS Material is in LTS mode

We are no longer accepting changes that are not critical bug fixes into this project.
See Long Term Support for more detail.

Bug Report

If you use md-selected-text on an md-select with a label, the label will not appear until a value has been selected.

Demo and steps to reproduce the issue

This blank StackBlitz demo can be used to create a reproduction that demonstrates your issue.

https://codepen.io/ewahner/pen/MWJPXJJ

Detailed Reproduction Steps

  1. Use md-selected-text on an md-select
  2. Use a label inside a md-input-container

Explain the expected behavior

The label should appear as a placeholder.

Explain the current behavior

The label is not visible until a value has been selected.

Discuss the use-case or motivation for changing the existing behavior

Feels broken

List the affected versions of AngularJS, Material, OS, and browsers

  • AngularJS: 1.8.2
  • AngularJS Material: 1.2.2
  • OS:
  • Browsers:
  • Screen Readers:

Add anything else we should know

Stack Trace


Screenshots

@ewahner ewahner added needs triage Issues that need initial triage type: bug labels Apr 20, 2021
@Splaktar Splaktar changed the title Label not visible on md-select when using md-selected-text select: label not visible when using md-selected-text Apr 27, 2021
@Splaktar
Copy link
Member

From the docs:

Expression to be evaluated that will return a string to be displayed as a placeholder in the select input box when it is closed.

The placeholder value depends on what your md-selected-text expression evaluates to.

Here's an example that sets the placeholder to State when the value is '' or 'None': https://codepen.io/Splaktar/pen/NWdmbVE?editors=1010

@Splaktar Splaktar added resolution: works as expected The functionality works as designed and documented. and removed needs triage Issues that need initial triage type: bug labels Apr 27, 2021
@Splaktar Splaktar self-assigned this Apr 27, 2021
@ewahner
Copy link
Author

ewahner commented Apr 28, 2021

I am not sure if that explains the behavior of the LABEL tag not working. I completely understand how to use the md-selected-text. I was trying to illustrate that if you use the md-selected-text and a label inside a md-input-container the label will not work. If it was designed that way, then I would say it was probably designed wrong.

@Splaktar Splaktar reopened this Apr 28, 2021
@Splaktar Splaktar added needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community needs triage Issues that need initial triage and removed resolution: works as expected The functionality works as designed and documented. labels Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community needs triage Issues that need initial triage
Projects
None yet
Development

No branches or pull requests

2 participants