Implement 'internal submit button' to the 'Textbox' component. Remove separate submit to the Headcode search card.
Adjust the hover and active styles of the 'TrainService' expandable cards.
This commit is contained in:
@@ -6,8 +6,7 @@
|
||||
|
||||
let headcode = $state('');
|
||||
|
||||
function handleSearch(e: SubmitEvent) {
|
||||
e.preventDefault();
|
||||
function handleSearch(headcode: string) {
|
||||
if (!headcode.trim()) return;
|
||||
|
||||
const searchParams = new URLSearchParams();
|
||||
@@ -18,10 +17,9 @@
|
||||
</script>
|
||||
|
||||
<BaseCard header={'Search Train & PIS'}>
|
||||
<form onsubmit={handleSearch} class="card-content">
|
||||
<Textbox placeholder="Enter Headcode" bind:value={headcode} maxLength={4} />
|
||||
<Button type="submit" disabled={!headcode}>Search</Button>
|
||||
</form>
|
||||
<div class="card-content">
|
||||
<Textbox placeholder="Enter Headcode" bind:value={headcode} maxLength={4} onsubmit={handleSearch} />
|
||||
</div>
|
||||
</BaseCard>
|
||||
|
||||
<style>
|
||||
@@ -29,7 +27,7 @@
|
||||
text-align: center;
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
padding: 10px 0 0 0;
|
||||
padding: 10px 0 0.5rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
|
||||
Reference in New Issue
Block a user