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); });