fix: accept direct icon URLs
Use valid direct HTTP(S) icon URLs without repository search.
This commit is contained in:
1 parent
fcc5130068
commit
edb56f3fcd
3 files changed
+15
-5
No files matched your search
@@ -165,8 +165,18 @@ export const IconPicker = ({
|
||||
leftSection={leftSection}
|
||||
value={inputValue}
|
||||
onChange={(event) => {
|
||||
combobox.openDropdown();
|
||||
setQuery(event.currentTarget.value);
|
||||
const nextValue = event.currentTarget.value;
|
||||
const trimmedValue = nextValue.trim();
|
||||
if (/^https?:\/\/[^\s/]+(?:\/\S*)?$/i.test(trimmedValue)) {
|
||||
startTransition(() => {
|
||||
setValue(trimmedValue);
|
||||
setQuery("");
|
||||
combobox.closeDropdown();
|
||||
});
|
||||
} else {
|
||||
combobox.openDropdown();
|
||||
setQuery(nextValue);
|
||||
}
|
||||
}}
|
||||
onClick={() => combobox.openDropdown()}
|
||||
onFocus={(event) => {
|
||||
|
||||
Reference in new issue
Block a user