jinruiyang Claude Opus 4.5 commited on
Commit
a91418e
·
1 Parent(s): 3ad6931

Change search input to textarea for better mobile experience

Browse files

- Use textarea instead of input for text wrapping on mobile
- Add min-height 70px on mobile for larger input area
- Handle Enter key to submit, Shift+Enter for new line

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Files changed (2) hide show
  1. frontend/index.html +4 -3
  2. frontend/js/app.js +5 -2
frontend/index.html CHANGED
@@ -76,9 +76,10 @@
76
  <div class="flex flex-col md:flex-row shadow-xl rounded-xl md:rounded-2xl bg-white relative z-10 border border-gray-200">
77
  <!-- Search Input -->
78
  <div class="flex-grow flex items-center px-4 md:px-6 border-b md:border-b-0 md:border-r border-gray-100">
79
- <input type="text" id="search-input"
80
- class="w-full text-emerald-950 outline-none text-[16px] md:text-[18px] py-3 md:py-0"
81
- placeholder="Ask about UAE...">
 
82
  </div>
83
 
84
  <!-- Category Dropdown -->
 
76
  <div class="flex flex-col md:flex-row shadow-xl rounded-xl md:rounded-2xl bg-white relative z-10 border border-gray-200">
77
  <!-- Search Input -->
78
  <div class="flex-grow flex items-center px-4 md:px-6 border-b md:border-b-0 md:border-r border-gray-100">
79
+ <textarea id="search-input"
80
+ class="w-full text-emerald-950 outline-none text-[16px] md:text-[18px] py-3 md:py-2 min-h-[70px] md:min-h-0 md:h-12 resize-none"
81
+ placeholder="Ask about UAE..."
82
+ rows="2"></textarea>
83
  </div>
84
 
85
  <!-- Category Dropdown -->
frontend/js/app.js CHANGED
@@ -278,8 +278,11 @@ function initDOM() {
278
  function initEventListeners() {
279
  // Search
280
  DOM.searchBtn?.addEventListener('click', handleSearch);
281
- DOM.searchInput?.addEventListener('keypress', (e) => {
282
- if (e.key === 'Enter') handleSearch();
 
 
 
283
  });
284
 
285
  // Category dropdown
 
278
  function initEventListeners() {
279
  // Search
280
  DOM.searchBtn?.addEventListener('click', handleSearch);
281
+ DOM.searchInput?.addEventListener('keydown', (e) => {
282
+ if (e.key === 'Enter' && !e.shiftKey) {
283
+ e.preventDefault();
284
+ handleSearch();
285
+ }
286
  });
287
 
288
  // Category dropdown