Add comprehensive debugging for dropdown selection issue

Added extensive console logging to diagnose why selected value
isn't displaying in the dropdown:
- Select element's full text content
- Selected index position
- Total options count
- Option text at selected index
- Explicitly setting 'selected' attribute on options

This will help identify whether the issue is with:
- Option selection not being applied
- Visual rendering despite correct selection
- Bootstrap form-select interference

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ken Johnson
2025-12-09 15:05:06 +00:00
parent ffac25bae3
commit b4a95e54a9
+11 -1
View File
@@ -167,8 +167,18 @@ $('#message_receiver_id').on('change', function() {
console.log('Selected recipient:', selectedText);
console.log('Selected value:', selectedValue);
console.log('Current display:', $select.css('color'));
console.log('Select element text:', $select.text());
console.log('Selected index:', this.selectedIndex);
console.log('Options count:', $select.find('option').length);
// Force re-render by temporarily hiding and showing
// Log the actual option that should be selected
console.log('Option at selectedIndex:', $select.find('option')[this.selectedIndex].text);
// Try forcing the selected attribute
$select.find('option').removeAttr('selected');
$select.find('option:selected').attr('selected', 'selected');
// Force re-render
$select.hide().show(0);
});