Skip to content

fix(typeahead): resolve [object Object] display issue with initial object values #6750

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

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

valorkin
Copy link
Member

Summary

  • Fixes typeahead displaying "[object Object]" when initialized with object values
  • Adds automatic detection of common display fields (name, label, title, text, value, display)
  • Improves getValueFromObject utility to handle objects without typeaheadOptionField
  • Maintains full backward compatibility with existing implementations

Test plan

  • Object values display correctly when typeaheadOptionField is specified
  • Auto-detection works for common field names (name, label, etc.)
  • Graceful fallback for objects without common fields
  • Unit tests cover all object value scenarios and edge cases
  • E2E tests verify behavior in real browser environment
  • No regressions in existing typeahead functionality

🤖 Generated with Claude Code

valorkin and others added 2 commits May 26, 2025 18:21
…ject values

- Add handleInitialObjectValue method to properly display object values on initialization
- Enhance getValueFromObject utility to auto-detect common display fields (name, label, title, etc.)
- Fix issue where typeahead shows "[object Object]" instead of proper field value
- Maintain backward compatibility while improving object value handling
- Add comprehensive unit tests for object value scenarios
- Add E2E tests to verify object value display behavior

Fixes #749

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

cloudflare-workers-and-pages bot commented May 26, 2025

Deploying ngx-bootstrap with  Cloudflare Pages  Cloudflare Pages

Latest commit: 522a696
Status:🚫  Build failed.

View logs

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

Successfully merging this pull request may close these issues.

1 participant