HomeSeer / Plugin-SDK

Plugin development kit for the 4th major edition of the HomeSeer platform.
https://www.nuget.org/packages/HomeSeer-PluginSDK/
GNU Affero General Public License v3.0
20 stars 4 forks source link

Settings page always returns to 1st tab after changing and saving a setting on any tab. #273

Open ralphPY opened 2 years ago

ralphPY commented 2 years ago

Description

The settings page always returns to the tab at index 0 after changing and saving a setting on any tab.

Regardless the setting Settings. SelectedPageIndex = Settings.IndexOf(pageId); (or as a test any hardcoded int value like SelectedPageIndex = 1;)

Screenshots

Not applicable

Expected Behavior

I expected to see the settingspage stay on the tab which was just modified and saved

Steps to Reproduce

  1. Create a plugin with more than one settingspage (or use HomeSeerSamplePlugin)
  2. Run plugin, navigate to 2nd or 3rd tab on settings page, change setting and click save button
  3. Watch the first tab becoming the active tab instead of the one you just changed.
  4. Add Settings.SelectedPageIndex = Settings.IndexOf(pageId); to OnSettingChange method in HSPI.cs
  5. Try step 2 again and see the same thing happening (this is the problem)
  6. undo step3 and add replace by Settings.Swap(Settings.IndexOf(pageId), 0);
  7. Try step 2 again and watch modified tab change position with first tab and staying open. (this is the workaround)

Logs

Not applicable

spudwebb commented 2 years ago

tracked as HS-1714