allaw-ui 4.8.5 → 4.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -130,12 +130,20 @@ var SearchBar = function (_a) {
|
|
|
130
130
|
console.error("Geolocation error:", err);
|
|
131
131
|
if (err.code === 1) {
|
|
132
132
|
console.error("Permission denied - user must allow location access");
|
|
133
|
+
// Proposer de réessayer
|
|
134
|
+
if (confirm("L'accès à la localisation a été refusé. Voulez-vous réessayer ?")) {
|
|
135
|
+
setTimeout(function () { return handleLocate(); }, 1000);
|
|
136
|
+
}
|
|
133
137
|
}
|
|
134
138
|
else if (err.code === 2) {
|
|
135
139
|
console.error("Position unavailable");
|
|
136
140
|
}
|
|
137
141
|
else if (err.code === 3) {
|
|
138
142
|
console.error("Timeout");
|
|
143
|
+
// Réessayer en cas de timeout
|
|
144
|
+
if (confirm("La localisation a pris trop de temps. Voulez-vous réessayer ?")) {
|
|
145
|
+
setTimeout(function () { return handleLocate(); }, 1000);
|
|
146
|
+
}
|
|
139
147
|
}
|
|
140
148
|
}, { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 });
|
|
141
149
|
};
|
|
@@ -159,6 +167,10 @@ var SearchBar = function (_a) {
|
|
|
159
167
|
React.createElement("i", { className: "allaw-icon-x-small" }))),
|
|
160
168
|
endIcon && (React.createElement("button", { className: styles.searchBarIconButton, tabIndex: -1, "aria-label": "Rechercher" },
|
|
161
169
|
React.createElement("i", { className: endIcon }))),
|
|
162
|
-
showLocate && (React.createElement("button", { type: "button", className: styles.searchBarLocateButton, onClick:
|
|
170
|
+
showLocate && (React.createElement("button", { type: "button", className: styles.searchBarLocateButton, onClick: function (e) {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
e.stopPropagation();
|
|
173
|
+
handleLocate();
|
|
174
|
+
}, "aria-label": "Me localiser", title: "Me localiser" }, "Me localiser"))));
|
|
163
175
|
};
|
|
164
176
|
export default SearchBar;
|