This commit is contained in:
2026-07-28 15:09:33 -04:00
parent 7d5f2023d0
commit c8778a282e
5 changed files with 43 additions and 6 deletions
+9 -1
View File
@@ -100,6 +100,7 @@ pub(crate) struct Publisher {
abbreviated_datatypes: Vec<String>,
window_id: window::Id,
url_input: String,
url_input_valid: bool,
navigator: Navigator<Url>,
document: RdfSource<KeyedDataset<RowState>>,
hovered_row: Option<QuadKey>,
@@ -157,6 +158,7 @@ impl Publisher {
abbreviated_datatypes,
window_id: id,
url_input: starting_url.to_string(),
url_input_valid: true,
navigator,
document,
hovered_row: None,
@@ -268,6 +270,11 @@ impl Publisher {
}
}
Message::URLInputChanged(value) => {
if Url::parse(&value).is_ok() {
self.url_input_valid = true;
} else {
self.url_input_valid = false;
}
self.url_input = value;
}
Message::URLInputSubmitted => {
@@ -868,7 +875,8 @@ impl Publisher {
let address_input = iri_input(&self.curie_helper, "URL", None, &self.url_input)
.on_input(Message::URLInputChanged)
.on_submit(Message::URLInputSubmitted)
.on_control_click(Message::OpenQueryWindow(SearchResultClickAction::URLInput));
.on_control_click(Message::OpenQueryWindow(SearchResultClickAction::URLInput))
.style(crate::theme::styles::text_input::required(!self.url_input_valid));
let mut rows: Vec<Element<Message>> = vec![];
rows = self