From b4a95e54a9a8b77b1688788998e34a591e9b1a7b Mon Sep 17 00:00:00 2001 From: Ken Johnson Date: Tue, 9 Dec 2025 15:05:06 +0000 Subject: [PATCH] Add comprehensive debugging for dropdown selection issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- app/views/messages/index.html.erb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/messages/index.html.erb b/app/views/messages/index.html.erb index ef262a7..96de30f 100644 --- a/app/views/messages/index.html.erb +++ b/app/views/messages/index.html.erb @@ -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); });