Skip to content

Commit 16b4b7e

Browse files
committed
Clear filter when switching profile
1 parent 6afa486 commit 16b4b7e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/evacipated/cardcrawl/modthespire/ui/ModSelectWindow.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,16 @@ private JPanel makeModListPanel()
330330
JButton addProfile = new JButton("+");
331331
JButton delProfile = new JButton("-");
332332

333+
TextFieldWithPlaceholder filter = new TextFieldWithPlaceholder();
334+
filter.setPlaceholder("Filter...");
335+
333336
profilesList.addActionListener((ActionEvent event) -> {
334337
String profileName = (String) profilesList.getSelectedItem();
335338
delProfile.setEnabled(!ModList.DEFAULT_LIST.equals(profileName));
336339
ModList newList = new ModList(profileName);
337340
DefaultListModel<ModPanel> newModel = (DefaultListModel<ModPanel>) modList.getModel();
338341
newList.loadModsInOrder(newModel, info, modList);
342+
filter.setText("");
339343

340344
Thread tCfg = new Thread(() -> {
341345
// Save new load order cfg
@@ -393,8 +397,6 @@ private JPanel makeModListPanel()
393397
});
394398
profilesPanel.add(delProfile, c);
395399

396-
TextFieldWithPlaceholder filter = new TextFieldWithPlaceholder();
397-
filter.setPlaceholder("Filter...");
398400
Runnable filterModList = () -> {
399401
String filterText = filter.getText().trim().toLowerCase();
400402
String[] filterKeys = filterText.length() == 0 ? null : filterText.split("\\s+");

0 commit comments

Comments
 (0)