|
| 1 | +<!DOCTYPE html> |
| 2 | +<html dir="ltr"> |
| 3 | + |
| 4 | +<head> |
| 5 | + <meta charset="UTF-8"> |
| 6 | + <title>Select - Basic</title> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> |
| 8 | + <link href="../../../../../css/ionic.bundle.css" rel="stylesheet"> |
| 9 | + <link href="../../../../../scripts/testing/styles.css" rel="stylesheet"> |
| 10 | + <script src="../../../../../dist/ionic.js"></script> |
| 11 | +</head> |
| 12 | + |
| 13 | +<body> |
| 14 | + <ion-app> |
| 15 | + |
| 16 | + <ion-header> |
| 17 | + <ion-toolbar> |
| 18 | + <ion-title>Select - Conflict</ion-title> |
| 19 | + </ion-toolbar> |
| 20 | + </ion-header> |
| 21 | + |
| 22 | + <ion-content> |
| 23 | + <ion-list> |
| 24 | + |
| 25 | + <ion-item> |
| 26 | + <ion-label>Alert</ion-label> |
| 27 | + <ion-select id="alert" placeholder="Select One" interface="alert"> |
| 28 | + <ion-select-option class="s-unselected">Unselected</ion-select-option> |
| 29 | + <ion-select-option class="s-zero">Zero</ion-select-option> |
| 30 | + <ion-select-option class="s-empty">Empty String</ion-select-option> |
| 31 | + <ion-select-option class="s-null">Null</ion-select-option> |
| 32 | + </ion-select> |
| 33 | + </ion-item> |
| 34 | + |
| 35 | + <ion-item> |
| 36 | + <ion-label>Action-sheet</ion-label> |
| 37 | + <ion-select id="action" placeholder="Select One" interface="action-sheet"> |
| 38 | + <ion-select-option class="s-unselected">Unselected</ion-select-option> |
| 39 | + <ion-select-option class="s-zero">Zero</ion-select-option> |
| 40 | + <ion-select-option class="s-empty">Empty String</ion-select-option> |
| 41 | + <ion-select-option class="s-null">Null</ion-select-option> |
| 42 | + </ion-select> |
| 43 | + </ion-item> |
| 44 | + |
| 45 | + <ion-item> |
| 46 | + <ion-label>Popover</ion-label> |
| 47 | + <ion-select id="popover" placeholder="Select One" interface="popover"> |
| 48 | + <ion-select-option class="s-unselected">Unselected</ion-select-option> |
| 49 | + <ion-select-option class="s-zero">Zero</ion-select-option> |
| 50 | + <ion-select-option class="s-empty">Empty String</ion-select-option> |
| 51 | + <ion-select-option class="s-null">Null</ion-select-option> |
| 52 | + </ion-select> |
| 53 | + </ion-item> |
| 54 | + |
| 55 | + <span id="results"></span> |
| 56 | + |
| 57 | + </ion-list> |
| 58 | + |
| 59 | + </ion-content> |
| 60 | + |
| 61 | + <script> |
| 62 | + Array.from(document.querySelectorAll('.s-unselected')).forEach(s => s.value = undefined); |
| 63 | + Array.from(document.querySelectorAll('.s-zero')).forEach(s => s.value = 0); |
| 64 | + Array.from(document.querySelectorAll('.s-empty')).forEach(s => s.value = ''); |
| 65 | + Array.from(document.querySelectorAll('.s-null')).forEach(s => s.value = null); |
| 66 | + |
| 67 | + function updateValues() { |
| 68 | + const alert = document.getElementById('alert').value; |
| 69 | + const actionSheet = document.getElementById('action').value; |
| 70 | + const popover = document.getElementById('popover').value; |
| 71 | + |
| 72 | + document.getElementById('results').textContent = ` |
| 73 | + Alert: ${alert} |
| 74 | + Action-sheet: ${actionSheet} |
| 75 | + Popover: ${popover} |
| 76 | + `; |
| 77 | + } |
| 78 | + document.addEventListener('ionChange', () => updateValues()); |
| 79 | + </script> |
| 80 | + </ion-app> |
| 81 | +</body> |
| 82 | + |
| 83 | +</html> |
0 commit comments