Isolate server search from the delete password prompt
The delete confirmation adds a password field. Browsers and password managers paired it with the only other text field on the page and filled the account name into the server search box on the server list. The search input now stays out of the DOM while a delete confirmation is open, and the toolbar shows a suspended notice styled to match the field it replaces so the row does not jump. A jsdom test drives the real action menu and dialog instead of asserting page source strings.
This commit is contained in:
@@ -505,19 +505,29 @@ export function ServersPage({ session, operations, onNavigate }: PageComponentPr
|
||||
|
||||
<div className="server-toolbar" role="search" data-form-type="other">
|
||||
<Search size={16} aria-hidden="true" />
|
||||
<input
|
||||
type="search"
|
||||
name="server-list-filter"
|
||||
autoComplete="new-password"
|
||||
data-1p-ignore="true"
|
||||
data-lpignore="true"
|
||||
data-bwignore="true"
|
||||
data-protonpass-ignore="true"
|
||||
value={keyword}
|
||||
placeholder="搜索服务器名称、ID 或插件"
|
||||
aria-label="搜索服务器"
|
||||
onChange={(event) => setKeyword(event.target.value)}
|
||||
/>
|
||||
{/* The delete prompt adds a password field, and browsers/password managers
|
||||
pair it with the only other text field on the page, filling the account
|
||||
name into the server search box. Keep the search field out of the DOM
|
||||
while that prompt is open instead of relying on autofill hints. */}
|
||||
{deleteConfirmation === null ? (
|
||||
<input
|
||||
type="search"
|
||||
name="server-list-filter"
|
||||
autoComplete="new-password"
|
||||
data-1p-ignore="true"
|
||||
data-lpignore="true"
|
||||
data-bwignore="true"
|
||||
data-protonpass-ignore="true"
|
||||
value={keyword}
|
||||
placeholder="搜索服务器名称、ID 或插件"
|
||||
aria-label="搜索服务器"
|
||||
onChange={(event) => setKeyword(event.target.value)}
|
||||
/>
|
||||
) : (
|
||||
<span className="server-search-suspended" aria-hidden="true">
|
||||
搜索暂时停用
|
||||
</span>
|
||||
)}
|
||||
{statusFilters.map((filter) => (
|
||||
<button
|
||||
key={filter.id}
|
||||
|
||||
Reference in New Issue
Block a user