sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

displayMode incorrect on Classic Pages

Open jaredbuttars opened this issue 10 years ago • 5 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Enhancement / Suggestion
  • [ ] Additional article idea

Expected or Desired Behavior

Standard "modern" page views displayMode should be: 1 Edit "modern" page views displayMode should be: 2 Standard "classic" page views displayMode should be: 1 Edit "classic" page views displayMode should be: 2

Observed Behavior

Standard "modern" page views displayMode is: 1 (correct) Edit "modern" page views displayMode is: 2 (correct) Standard "classic" page views displayMode is: 1 (correct) Edit "classic" page views displayMode is: 1 (bug?)

displayMode on classic pages only switches to 2 when editing a web part, or after editing a web part.

Steps to Reproduce

Log the displayMode of the webpart to the console and observe in various modes on both classic and modern pages.

jaredbuttars avatar Sep 21 '16 19:09 jaredbuttars

Yes, this is by design at the current time. Classic pages have 3 states instead of 2. Read mode, page in edit mod and web part in edit mode. Lets me explain in more detail.

In the classic pages, a web part displayMode switches to edit mode only when you switch that particular web part to edit mode. The reason being that in the classic pages, in order to save the property pane settings, today, you are required to click on the OK button of the classic page toolpart once you are done with the configuration changes. Without that, the settings won't persist. The toolpart is associated with only the web part that is in edit mode.

Hope that explains the current behavior. We are looking at ways to make the classic page configuration experience smoother. Open to ideas.

manishgarg1 avatar Sep 22 '16 19:09 manishgarg1

What values should be returned from displayMode on classic pages? I only seem to be able to get two values, 1 or 2 in all modes.

jaredbuttars avatar Sep 22 '16 20:09 jaredbuttars

Yes, client side web parts only have two states Read === 1, Edit === 2. Both in classic and modern pages. There is one "page level" difference between the classic pages and modern pages. In a classic page, only one web part can be in edit mode at any time. In modern pages, if the page is in edit mode then all web parts in that page are in edit mode.

manishgarg1 avatar Sep 26 '16 06:09 manishgarg1

I am closing this bug because it appears the question was answered. If not, please reopen the bug.

octogonz avatar Oct 06 '16 02:10 octogonz

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 30 '20 06:01 msft-github-bot